To set the value attribute, we can simply use the set Attribute method of the option element object.
Finally, we append this newly created option element to the list as a child element itself. If we know the index of the option in the list, we can simply use the remove method of the list object to remove the option.
First, download the Java Script form validation script here.
For example, you can have an input field that should not be empty, should be less than 25 chars and should be alpha-numeric. In some dynamically programmed pages, it may be required to change the validations in the form at run time.
In other words, in order to validate a field, you just associate a set of validation descriptors for each input field in the form. For such cases, a function is included which clears all validations in the validator object. Note that this validation if for fields like Textbox and multi-line text box.
For ‘selections’ like drop down and radio group, use an appropriate validation like ‘dontselect’ or ‘selone_radio’.
The idea is to create a set of “validation descriptors” associated with each element in a form.By default the caption for that list is the first item.For example if you’re asking a user to select a country the first option is “Select a country” and the name of the countries follow so we need to check if the first option is selected and then display a message to select an option.I have two dropdown lists to select value from 0 to 23.What I want is that when the user selects a value from the first list, he cannot select a value lower than this value in the second list.