Setup Default Choice In Dynamic Select

I have several dynamic select fields that work perfectly. However, what I would like to do is set a default choice, and if necessary, be able to change a different choice.

Is this possible? If so, how do you add this to existing dynamic select fields?

Here’s the typical dynamic select field Wappler code:

Thanks for your help or suggestions!

Hello JR,
Which should be the default choice here?

Your question just may have set the issue straight. So I would need to replace the option ‘Choice’ and replace it with the other default choice. I’m guessing that’s the answer to my question.

However, that would then place two choices that would be the same. Correct?

My question is - is some of the dynamic values supposed to be selected, or is it the static one that should be selected?

Yes. The choice as seen in the code is the default without anything selected, "Choose One’ … My goal is to have one of the ‘country’ choices selected as a default. For example, to have ‘USA’ as a default ‘selected’ choice.

You can try adding:

dmx-bind:selected="country_name == 'USA'"

I tried it and several other variations, and it continue to be non responsive. I may just leave it as it is.

Sorry i was on my phone, provided a wrong attribute.
All you need to do is to select dynamic attributes > input > value and enter 'USA' there:


1 Like

No apology necessary! Thank you very much for your tutorial expertise – with or without your phone.