Skip to main content

Hi,

 

I have a form with a list lookup (dropdown) in a repeating section. I already added a choice in the list lookup (with JS) but when the user adds a row  into the repeating section, the choice that I've added with JS disappear.

 

I use a JS like this and It work for the first dropdown ...

$("#"+myCustomIdListLookup).append("<option value="other">Other(s)</option>");

 

But when the user added row into the repeating section, the choice disappeared in the next dropdown

 

How can I fix that ?

 

I supposed that the name or ID of the dropdown change when a row is added but I don't know how catch/get this new name ?

 

BR

Theo

Hi Theo,

to access controls in repeating section use class names and javascript events for Nintex Forms, see JavaScript events in Nintex Forms .

Only controls in first row can be adressed by Client ID in JavaScript variable.

Kind regards

Manfred


Thanks for quick reply. Yes, I already found these functions but I don't know how can I really use this function.

Why ?

Because I try a JS like this and it not work :

NWF.FormFiller.Events.RegisterRepeaterRowAdding(function () {

        NWF$(".classOnMyDropdown").append("<option value=other>Other(s)</option>");

});


Now I use :

NWF.FormFiller.Events.RegisterRepeaterRowAdding(function () {

        NWF$(".dropdown .nf-filler-control-border .nf-filler-control-inner .nf-associated-control").append("<option value=other>Other(s)</option>");

});

It's not the function that I want but I know I'm close.

Thanks for your help

BR

Theo

NB : I come back with correct JS


I found my solution here : https://community.nintex.com/message/25881#22392

 

That's THE SOLUTION !

 

1. Add CSS class for your repeating section (.css-class-of-your-repeating-section)

2. Add CSS class for you list lookup (.css-class-of-your-dropdown-list)

3. Add this JS in your Form tab > Setting > Custom Javascript :

 

NWF.FormFiller.Events.RegisterRepeaterRowAdded(function () {

        NWF$ (".css-class-of-your-repeating-section .nf-repeater-row:last .css-class-of-your-dropdown-list select").append("<option value=other>Other</option>");

});

 

NWF$(document).ready(function () {

    NWF$("#"+idJsForTheFirstRow).append ("<option value=other>Other</option>");

    ... //Other JS function

});

 

Enjoy !

BR

 

Theo Delsante


Reply