Validate Individual Form Field In Magento

Validating an individual form field in Magento is pretty easy.
You can use the inbuilt Magento function named Validation.validate().

You can do this in two way
1) Call the function from the individual field
2) Call the function on some event
Below is the example code to validate it on blur event.

 

<input class=”input-text required-entry” id=”name” title=”First Name” type=”text” name=”name” value=”” onblur=”validate(this)”/>

function validate(id){
Validation.validate(id);
}