I'm relatively new to javascript. I know you can find the default (original) value of a text input field by using this.defaultValue. Is there an equivalent property for a dropdown list (<select><option>), or radio button list or checkbox list? .defaultValue doesn't seem to work.
I can simply add a hidden field to keep track of the value but I'm not sure if there is a better way to do it.
Radio & Checkbox = defaultChecked
Doesn't look like drop down list has one.
Not sure if this is what you are looking for, because I think this will only tell you if any individual input was checked or not, not for the entire group what was checked. Could be wrong on this though.
Thank you both for your replies. You pointed me in the right direction.
There is a defaultSelected property for <option> elements, similar to defaultChecked for radio buttons and checkboxes. But there doesn't appear to be any property to get the value of the collective group of elements (i.e. selectTag.defaultSelected).
I can either loop through the elements or just store the value somewhere, like a hidden field or a var like Y_Less suggested.
Bookmarks