Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set value for TaxonomyWebTaggingControl control
//Set Taxonomy ControlObject value
//webTaggingId - TaxonomyWebTaggingControl ID
//termValue - represents a single value held in a TaxonomyField object using the following format: NameOfTerm|GUIDOfTerm
function setTaxonomyControlObjectValue(webTaggingId, termValue) {
var webTaggingCtl = $get(webTaggingId);
var taxCtlObj = new Microsoft.SharePoint.Taxonomy.ControlObject(webTaggingCtl);
taxCtlObj.enableControl(true);
taxCtlObj.setRawText(termValue);
taxCtlObj.retrieveTerms();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment