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()); }
Solved! Go 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'));
})
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.
it's just a feature of post editor