Best method for setting default text on select elements in editor?
Best method for setting default text on select elements in editor?
johnmc0831
Posts: 3Questions: 1Answers: 0
in Editor
I'm current setting the options for my select boxes in the editor using ipOpts:
{
label: "Location:",
name: "LocationID",
type: 'select',
ipOpts: getLocations()
}
This works just fine. What I'm looking to do is to set the default text to "- Please Select -" in the select itself. I've tried using the 'def:' options but to no avail. Before I stack hacking with jQuery, any advice on how best to do this?
This discussion has been closed.
Answers
Scratch that...figgered it out. You need to pass the value to the def: option, not the text. Duh.
Hi,
Heh - good to hear you got it sorted out :-).
One thing - if your
getLocations()
method is currently using Sjax (i.e. $.ajax withasync: false
) you could use theupdate()
method for theselect
field type which could potentially speed things up. Not sure whatgetLocations()
is currently doing, but mention it just in case it might be useful!Regards,
Allan
Good guess...it's indeed making an AJAX call. I will try the update() method...