Hi Nintex Community,
Solved! Go to Solution.
I finally managed to populate a Nintex managed metadata control with jquery!
Here is the explained code :
/* Modify the metadata field */ var metadataField = $('#' + fieldID).find('div[role="textbox"]'); metadataField.html("Term"); /* Update the hidden input value (Useless if terms have unique name) */ var hiddenField = $('#' + fieldID).find('input[type="hidden"]'); hiddenField.val("Term|00000000-0000-0000-0000-000000000000"); /* Get the parent HTML element (same id without "editableRegion" at the end)*/ var parentId = metadataField.attr("id").replace("editableRegion",""); var element = $('#' +parentId).get(0); /* Validate my metadata field */ var controlObject = new Microsoft.SharePoint.Taxonomy.ControlObject(element); controlObject.validateAll();
Hope it'ill help.
Thank you so much Canatan, you saved my day!
In my case it was easier to assign a css class name to the control and then replace this line:
var metadataField = $('#' + fieldID).find('div[role="textbox"]');
for this one:
var metadataField = $('.class_name').find('div[role="textbox"]');
For some reason it didn't find the control with the field id.
Are you talking about a Metadata Control Nintex Forms 2013 ? I am using Office 365 Forms and there aren't Managed Metadata Controls as far as I can see. I have managed metadata columns in my custom list but Nintex Forms ignores them ;-(
Here is a very condensed how-to:
6. Save & Publish the form.