The drop down select list boxes usually will have one item saying ‘Select One’ (and that item will be selected by default).
The name can’t be empty and password can’t be less than 6 characters long. The user will not be forwarded to the next page until given values are correct.
js/You can do this from any layout file (preferably your module’s layout file), Magento did it in their theme’s layout page called located in app/design/frontend/base/default/layout/Hope this clears some things up for you.
At the very least, you now have a list of all validation classes in Magento.
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’.
Magento uses Prototype library to manage form validation.
This comes in handy, because all you need to do when writing custom form is to assign a valid class names to your input fields, and pass the form id to Varien Form object.
Even though this plugin has a wide range of validation functions it's designed to require as little network traffic as possible.
This is achieved by grouping together validation functions in "modules", making it possible to load only those functions that's needed to validate a particular form.
Note: This is a revamp of an article originally written in January 2009.