I have a repeating section with 4 text box in each row. for some validations I need to access value of these textboxes in javascript. I am beginner. I need a code sample . please help
Solved! Go to Solution.
HI,
When do you need to process your validations?
Is this a validation made line by line? Or for the entire repeating section?
thanks Fudala for your answer
this is a validation for entire repeating section.
I am going to put a validation function on my submit button.
I assume you set a Css class on your repeating setion control (such as "your-repeater") and others on textbox controls.
function ParseRepeater()
{
NWF$(".your-repeater .nf-repeater-row:not('.nf-repeater-row-hidden')").each(function ()
{
var $row = NWF$(this);
var $input1Val = $row.find(".input1 input").val();
var $input2Val = $row.find(".input2 input").val();
var $input3Val = $row.find(".input3 input").val();
var $input4Val = $row.find(".input4 input").val();
});
}
I should write exactcly like this. or for css "your repeater" is enough?
in other words
NWF$(".your-repeater .nf-repeater-row:not('.nf-repeater-row-hidden')").each(function ()
or
NWF$('.your-repeater').each(function ()
You need the first syntax.
To explain a little bit more, your-repeater is the CSS class of the repeating section, which is a container.
In this container, there are one or more lines that are detected by an internal class nf-repeater-row.
There is a space character between this two classes, which means your-repeater "contains" nf-repeater-row.
We avoid lines that has nf-repeater-row-hidden class wihch are only useful for an internal Nintex behavior.
thanks a lot. Pierre Fudala
It worked smootly
your answer was exact and obvious
Glad to be helpful !
Pierre,
I can run the NWF$().each() function, but it still establishes the hidden row as an object, regardless of the not: selector. I included an index argument in the anonymous function, and index 0 is the hidden row. Any thoughts on how I can exclude this hidden row?
PS I could easily add an if that excludes index = 0, but that's a bit of a hack!
Hello!
Any idea why the loop NWF$(".your-repeater .nf-repeater-row:not('.nf-repeater-row-hidden')").each(function () would skip even numbered rows after a row has been deleted? I used your example and it works great, however after I delete a repeating row, (doesn't matter which one, even or odd rows) this loop skips all even numbered rows next time it runs.
Thanks,
Brad