0

How could I set/change the value of an enterprise keyword field in a form using javascript?

0

Well, The Enterprise Keyword works pretty similar to the Managed Metadata Field... So i was able to set the values as i did with the Managed Metadata Field (using javascript):

    var myMetadataField = $('div[Title="' + MetadataField + '"]').find('div[role="textbox"]');
    myMetadataField.text("");

    var myMetadataField = $('div[Title="' + MetadataField + '"]').find('div[role="textbox"]');
    var myContainer = myMetadataField.parent().parent().parent();
    var divElement = myContainer.get(0);
    myMetadataField.text(listData.join(";"));

    var controlObject = new Microsoft.SharePoint.Taxonomy.ControlObject(divElement);
    controlObject.validateAll();

Where MetadataField is the title of your managed Metadata field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.