For ‘selections’ like drop down and radio group, use an appropriate validation like ‘dontselect’ or ‘selone_radio’.This validation descriptor is valid only for drop down lists.
The idea is to create a set of “validation descriptors” associated with each element in a form.You'll see that the all validation scripts presented on this and subsequent pages adhere to the same basic format.Most modern browsers now support HTML5 Form Validation making it possible to validate form elements without (or before) any Java Script is triggered.If you're working with arrays of checkboxes to submit data to a server-side script then you might already have some grey hairs from trying to figure out how to validate the input using Java Script.The problem is that, to have the data submitted in a 'nice' format to the server, the function returns an array containing all the selected checkbox values. In more complicated forms you will want to set conditions on the form that combine multiple elements.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.I tested your first piece of code on a form and it does not work at all.Tried setting it up on onsubmit on both form and button and no go.The “validation descriptor” is nothing but a string specifying the type of validation to be performed.Each field in the form can have zero one or more validations. More info & downloads where Do My Validation One() and Do My Validation Two() are custom functions for validation.Radio buttons are implemented as if they were an array of checkboxes.