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

How can I add option on dropdown list lookup ?

Jump to solution

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

Labels: (3)
0 Kudos
Reply
4 Replies
mlauer
Nintex Newbie

Re: How can I get the name or ID of a list lookup in repeating section, everytime that user add row ?

Jump to solution

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

0 Kudos
Reply
zaert
Nintex Newbie

Re: How can I get the name or ID of a list lookup in repeating section, everytime that user add row ?

Jump to solution

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

});

0 Kudos
Reply
zaert
Nintex Newbie

Re: How can I get the name or ID of a list lookup in repeating section, everytime that user add row ?

Jump to solution

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

0 Kudos
Reply
zaert
Nintex Newbie

Re: How can I get the name or ID of a list lookup in repeating section, everytime that user add row ?

Jump to solution

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

0 Kudos
Reply