Page 1 of 1

Managed Metadata

Posted: 19 Dec 2013
by Jeff Childers
I need the ability to create and set managed metadata columns based on the value of an item in a form. I notice that setting managed metadata is not included in your post on how to set field values.

Is this something that I can do with SPFORM or do I need to turn to spservices or something similar to do so?

Re: Managed Metadata

Posted: 22 Dec 2013
by Dmitry Kozlov
Hello Jeff,

Thank you for your question. Please, try the following code to set Managed Metadata field:

Code: Select all

fd.field('Metadata').control()._el()
    .find('.ms-inputBox').html('Term 2');

var metadata = new Microsoft.SharePoint.Taxonomy.ControlObject(
    fd.field('Metadata').control()._el().find('.ms-taxonomy').get(0));

metadata.validateAll();
Replace 'Metadata' with the internal name of your field in both places and 'Term 2' with the title of your term.