cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

get feilds value in repeating section with javascript?

Jump to solution

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

Labels: (1)
Tags (1)
0 Kudos
Reply
17 Replies
pfudala
Nintex Newbie

Re: get feilds value in repeating section with javascript?

Jump 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?

0 Kudos
Reply
Not applicable

Re: get feilds value in repeating section with javascript?

Jump to solution

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.

0 Kudos
Reply
pfudala
Nintex Newbie

Re: get feilds value in repeating section with javascript?

Jump to solution

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

        });

    }

Reply
Not applicable

Re: get feilds value in repeating section with javascript?

Jump to solution

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

0 Kudos
Reply
pfudala
Nintex Newbie

Re: get feilds value in repeating section with javascript?

Jump to solution

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.

0 Kudos
Reply
Not applicable

Re: get feilds value in repeating section with javascript?

Jump to solution

thanks a lot. Pierre Fudala

It worked smootly
your answer was exact and obvious

0 Kudos
Reply
pfudala
Nintex Newbie

Re: get feilds value in repeating section with javascript?

Jump to solution

Glad to be helpful !

0 Kudos
Reply
Not applicable

Re: get feilds value in repeating section with javascript?

Jump to solution

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!

0 Kudos
Reply
Not applicable

Re: get feilds value in repeating section with javascript?

Jump to solution

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

0 Kudos
Reply