Buy Now
Sign in

HowTo: dynamically loaded dropdown with default empty option

healyhatman 9
August 08 2018, 06:09 #379498
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
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}
Web developer at - I DO NOT work for ChronoEngine!
Professional Work:
Custom CF / CC Plugins and Extensions: