Skip to main content
Nintex Community Menu Bar

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

  • February 7, 2018
  • 4 replies
  • 18 views

Forum|alt.badge.img+1

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()); }

4 replies

Forum|alt.badge.img+14
  • Scholar
  • February 7, 2018

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‌


Forum|alt.badge.img+1
  • Author
  • February 7, 2018

Thanks so much  ! This works perfectly happy.png


Forum|alt.badge.img+3
  • December 13, 2018

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.


Forum|alt.badge.img+14
  • Scholar
  • December 28, 2018

it's just a feature of post editor happy.png 

221755_pastedImage_1.png