Forums

HowTo: dynamically loaded dropdown with default empty option

healyhatman 08 Aug, 2018
2 Likes
So you may have noticed that sometimes when you have a dynamically loaded dropdown, your empty option doesn't appear to work properly when nothing has been loaded yet. For example in "Options" you might have
=Please select
{var:list_policy_options}
Now if {var:list_policy_options} is empty, say because you've just loaded the form and haven't yet triggered an action to load the data, for some reason that empty "Please select" option doesn't show up. WELL all you need to do is put the following in your options
=Default message after field is reloaded
{var:list_policy_options/=Default message before field is reloaded}
This way, when the field first gets displayed you can have a message / empty option there, which gets replaced when you reload the field. For example
=Select state
{var:list_of_models/=Choose country first}
This topic is locked and no more replies can be posted.