Repeating section drop down list options

  • 23 September 2015
  • 29 replies
  • 19 views

Badge +3

Hi all,

I have a drop down list in a repeating section, where the option values are populated dynamically using JavaScript below.

NWF$("#" + accounts).append(options);

where accounts is the drop down list name and options are values that is populated as choices.

This works fine and the drop down list in the repeating section gets populated.

However, when I add a new row in the repeating section, drop down list in the new row does not have these choices.

Is there a way I can maintain the choices throughout the entire repeating section?

If not, how can I access the new row to populate the same choices?

thanks.


29 replies

Userlevel 5
Badge +9

you can try with this :

$row.find(".cssman select").append(options);

Userlevel 5
Badge +9

That's very cool that it works !

You're welcome wink.png

Do you mean that it adds the option three times ?

If yes, you can try by replacing your first line with this one :

NWF$(".nf-outer").on("blur",".my-dropdown select",function()

Userlevel 5
Badge +9

ok, then you can add a check before adding the option :

if($row.find(".cssman select option[value='102']").length == 0) {

$row.find(".cssman select").append(options);

}

Userlevel 5
Badge +9

cool, I'm glad that I could help you.

I've taken a look at your other problem.

Reply