cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Adding a change event, to a list lookup, in a repeat section

Jump to solution

Hi,

I am trying to add a change event, to a list lookup, in a repeat section, using JavaScript.

Currently I am adding the event handler in the RegisterRepeaterRowAdded function. But the change event only fires when a new row is added. I would like the event to fire any time the user changes the lookup.

NWF.FormFiller.Events.RegisterRepeaterRowAdded(function (){

   var currRow = NWF$(arguments[0][0]);

   currRow.find('.cable-lookup select').change(

      repeatCableChanged(currRow.find('.cable-lookup select'))

   );

});

function repeatCableChanged(cableLookup) { alert(cableLookup.val()); }

Labels: (2)
0 Kudos
Reply
4 Replies
Workflow Hero

Re: Adding a change event, to a list lookup, in a repeat section

Jump to solution

the problem with your code is that you do not attach a handler function that should be invoked when the event happens but rather result of function call.

your code should look like

currRow.find('.cable-lookup select').change(repeatCableChanged);

or

currRow.find('.cable-lookup select').change(function(){
      repeatCableChanged(currRow.find('.cable-lookup select'));
})‍‍‍‍‍‍

repeating section‌ control‌ lookup‌

0 Kudos
Reply
Workflow Hero

Re: Adding a change event, to a list lookup, in a repeat section

Jump to solution

Thanks so much  ! This works perfectly

Reply
Workflow Hero

Re: Adding a change event, to a list lookup, in a repeat section

Jump to solution

Thanks for the solution Marian Hatala‌ .

Just curious , how do you get the script colour coded . Is there someplace where we can test for syntax error etc ... rather than testing in Nintex form.

0 Kudos
Reply
Workflow Hero

Re: Adding a change event, to a list lookup, in a repeat section

Jump to solution

it's just a feature of post editor  

Reply