SELECT equivalent of an INPUT defaultValue?
Interesting question: Does a form SELECT have an equivalent to a form INPUT type="text" defaultValue?
Is there an equivalent for a SELECT option? If a different option is selected, can you compare that new option selectedIndex value to the original option selectedIndex value that was when the form first loads?
Can you provide a description where this could be used?
A small example of what it is that you are trying to do?
I was trying to get fancy-shmancy with some validation.
Basically, there is a select that contains an initial option (value 0, display "All Reports") and that is followed by a db query of (value employee ids, display employee name) so a supervisor can view an individual's record. I just wanted to keep the submit button disabled until a different option is selected. That's why I wanted to compare current selectedIndex against original selectedIndex (when form first loads.)
Sadly, that function was causing some conflict with something else, so just a few minutes ago it was scrapped. I was just on my way here to cancel the request.
an option has an option.defaultSelected value of true if it has the attribute 'selected' in the html source, otherwise the value is false.
You can use it to see if the user has selected something other than the original default- if you want to.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread