cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

JavaScript update multiple Yes/No fields in repeating table

Hello all

I have been reading through the forum posts to try and figure out how to fix my problem, but being at level 0 experience with JavaScript and repeating table interaction I'm now having to ask for help.

Basically, I have multiple yes/no fields (at this point 4) in a repeating section.  The user can pick only one.  The idea being if they select Box 1, then change their mind and pick Box 2, Box 1 is automatically deselected.

I have he solution working when not in a repeating section, however, as soon as I move it into the repeating section it doesn't work.  I have "learnt" from the various posts that I have to use CSS to reference each box, so I have done that.  Where I think I'm stuck is the looping through each option for each row, I'm sure I have missed a bracket or semi colon some where.  

 

I have been using the .click() event, but I'm guessing that doesn't work within a repeating section so I also tried .change() with no success.

 

The repeating section has been assigned the CSS id of myRepeater.

Each check box has the "Control CSS Class" and "CSS class" set to jsTestx (x being the checkbox number).  Not sure if I need both Control CSS and CSS class.

 

Below is the code that actually allows me to load the form (but does not work).  I know there is probably a way to iterate though each checkbox without specifying each one, but I cant even get one check box in a row to work...yet.

 

NWF$(".myRepeater .nf-repeater-row:not('.nf-repeater-row-hidden')").each(function()
{
var row = NWF$(this);

row((".jsTest1").click()).each(function()
{
row(".jsTest2").attr('checked', false);
row(".jsTest3").attr('checked', false);
row(".jsTest4").attr('checked', false);
row(".jsOutput").val("jsTest1");
});

row((".jsTest2").click()).each(function()
{
row(".jsTest1").attr('checked', false);
row(".jsTest3").attr('checked', false);
row(".jsTest4").attr('checked', false);
row(".jsOutput").val("jsTest2");
});
row((".jsTest3").click()).each(function()
{
row(".jsTest1").attr('checked', false);
row(".jsTest2").attr('checked', false);
row(".jsTest4").attr('checked', false);
row(".jsOutput").val("jsTest3");
});
row((".jsTest4").click()).each(function()
{
row(".jsTest1").attr('checked', false);
row(".jsTest2").attr('checked', false);
row(".jsTest3").attr('checked', false);
row(".jsOutput").val("jsTest4");
});
});

 

 

Also, is there a way to debug JavaScript within Nintex forms?

I'm happy if you drop hints at what to try as it will help me learn.

Labels: (1)
0 Kudos
Reply