Skip to content

Instantly share code, notes, and snippets.

@vgrem
Created January 23, 2013 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgrem/4611065 to your computer and use it in GitHub Desktop.
Save vgrem/4611065 to your computer and use it in GitHub Desktop.
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