The tooltip in your screenshot says that the value of your managed metadata field will NOT be provided to your validation function.
This means you need to get the fields value manually inside your validation function. See s answer in the post you referenced to see what can be done here.
Cheers
Philipp
Thanks for the reply Philipp Lucas Lucas. I tried what Caroline Jung suggested, still not able to alert the value. Am I missing something? I guess I am struggling where to apply that code she provided, under custom javascript section or under custom validation function in the control? How to test what value is stored?
Thanks for your help!
Best Practice would be to store the code inside a JS-File. Upload that JS-File to your SharePoint-Site (e.g. SiteAssets Library) and reference it inside your form settings. But for a small test you can also put this code inside the custom javascript section.
Inside the funtion you need to query the control from which you want to get the value from like NWF$("#"+MyFieldID).value() and you can alert this value to test it.
I used Using SharePoint TaxonomyWebTaggingControl control: Access and manipulate from client side | YASP Blog
and added as Custom Javascript to form:
NWF.FormFiller.Events.RegisterAfterReady(function () {
ExecuteOrDelayUntilScriptLoaded(initTaggingControl, 'ScriptForWebTaggingUI.js');
});
function initTaggingControl() {
RTE.CanvasEvents.registerListener(RTE.CanvasEvents.editableRegionChangedEvent,
Function.createDelegate(null, OnTaxonomyDataUpdatedDelegate));
}
function OnTaxonomyDataUpdatedDelegate() {
//do whatever you want when value of taxonomy field changes
}
Thanks Antonina, your post was the final solution. The event handler worked for all fields but not for metadatefields in nintex forms. With your code, also the metadafield eventhandler were fine
I used the method from Antonina to copy the value to a hidden textField. Then I can use the rules to react on the hiddenTextField.
Finally to make to rules check the new value, use the trigger("blur") Method. Then the rules start taking effect of the new value,
txtField.trigger("blur");
This helped me to design a Nintex Form using Metadata fields and hide/show depending on the Metadatefields additional panels and fields.
Mycode Example:
NWF.FormFiller.Events.RegisterAfterReady(function () {
CheckVertragstyp();
ExecuteOrDelayUntilScriptLoaded(initTaggingControl, 'ScriptForWebTaggingUI.js');});
function initTaggingControl() { RTE.CanvasEvents.registerListener(RTE.CanvasEvents.editableRegionChangedEvent, Function.createDelegate(null, OnTaxonomyDataUpdatedDelegate));}function OnTaxonomyDataUpdatedDelegate() {
CheckVertragstyp()}
function CheckVertragstyp(){
NWF$("#" +VertragstypHiddenField).val(NWF$("#" +Vertragstyp_ClientID).find("inpututype='hidden']").val()).trigger("blur");
}