Rule not firing when using Java Script to set a field valuse

  • 21 November 2018
  • 1 reply
  • 2 views

Badge +1

I have a set of different controls that all set the Status value.  The Jave script to do that works great.  The issue I am having is when the change is made a rule to unhide the corrections box is not firing.  I have tried using the below article suggestion but that does not seem to work either.  nintex Can someone help point me in the correct direction?  The control is a choice.  Below is my javaScript

NWF.FormFiller.Events.RegisterAfterReady(function () {  
   NWF$('#' + DeanApproval).on('change', function () {
       valueChanged(NWF$('#'+ DeanApproval + ' input:checked').val()); NWF.FormFiller.Functions.control.trigger('StatusControl');                   
   }); NWF$('#' + ProvostStatus).on('change', function () {
       valueChanged(NWF$('#'+ ProvostStatus + ' input:checked').val());                             
   });
 NWF$('#' + BudgetStatus).on('change', function () {       valueChanged(NWF$('#'+ BudgetStatus + ' input:checked').val());                                });
 NWF$('#' + HRStatus).on('change', function () {       valueChanged(NWF$('#'+ HRStatus + ' input:checked').val());                                });
}); function valueChanged(newValue){   NWF$("#" + StatusControl).val(newValue); NWF.FormFiller.Functions.control.trigger('StatusControl');
}function showPanel(){NWF$('#' + RevisionID).val(1).trigger('blur');} function hidePanel(){NWF$('#' + RevisionID).val(0).trigger('blur');}


1 reply

Userlevel 5
Badge +14

try to change in valueChanged() function line 

NWF$("#" + StatusControl).val(newValue);

to

NWF$("#" + StatusControl).val(newValue).change();

... and remove all the lines with 

NWF.FormFiller.Functions.control.trigger....

it's not a valid construct

Reply