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

Get element of Forms Repeating section using jQuery

Jump to solution

Is there a way, how to get an input field, which is inside a repeating section, with jQuery?

Storing Cliend ID in a variable does not help, as the same "var" is assigned for all the repeated fields.

Perhaps there's a way how to determine the ID that's generated for each and every field?

ctl00_SPWebPartManager1_g_5f4ccd00_2da1_4ce1_b83e_a7adcfab8b88_ctl00_ListForm2_formFiller_FormView_ctl42_01641dee_38ca_42ee_9ee9_1d19f889520a_ctl01_ctl03_16117911_00d1_4a30_a4b7_4ae100d973e5

Labels: (1)
0 Kudos
Reply
5 Replies
fhunth
Nintex Newbie

Re: Get element of Forms Repeating section using jQuery

Jump to solution

I think you can set a css class to your input field and then query them on jquery

0 Kudos
Reply
sandfish69
Nintex Newbie

Re: Get element of Forms Repeating section using jQuery

Jump to solution

In this case they all will share the same class, however, I need to query each field separately.

The idea is that I want to have a jQuery-based solution that OnClick populates the input field with current datetime.

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Get element of Forms Repeating section using jQuery

Jump to solution

Hi Maris

see JavaScript events in Nintex Forms  from Emily Billing

Kind regards

Manfred

Reply
Automation Master
Automation Master

Re: Get element of Forms Repeating section using jQuery

Jump to solution

I agree with Manfred and Fernando, you can use the JavaScript events to execute a custom function each time a row is added with the repeater row added event. Then you can get the last row of the repeating section with jquery and get your datetime field via a custom css class that you can add to this control.

Hope this helps

View solution in original post

0 Kudos
Reply
janp
Nintex Newbie

Re: Get element of Forms Repeating section using jQuery

Jump to solution

Hi Maris,

In addition to the above, I've been able to wire up line specific control triggers following a blog post here.

Something similar to this:

NWF$('.EquipmentQuantity').change(function() {

  triggeringClassElement = this;
  NWF$(calculateEquipmentLineCost);
  NWF$(calculateEquipmentTotalCost);
});

and then

  • function calculateEquipmentLineCost(){
    var lineItemTotal = 0;

    var quantity = 0;
    var rate = 0;

    NWF$(triggeringClassElement).parents('.nf-repeater-row').children('.EquipmentQuantity').find('input').not('.nf-hidden-associated-control').not('.nocalc').each(function(i,n){
      quantity = isNaN(parseFloat(NWF$(n).val())) ? 0 : parseFloat(NWF$(n).val());
        });

The triggeringClassElement = this; is what helped me target the line and then the specific control within the line.

0 Kudos
Reply