Jul 30, 2012

Magento: How to override prototype form validations.


Step 1:
if(Validation) {  
Validation.addAllThese([
[
'custom-form-validation-zip-class',
'Please enter the vaild zip code.',
function(v)
{
if (!(/^[0-9-]+$/.test(v))) {
return false;
}
return true;
}
],
   [ ]
])
}

Step  2:
<input type="text" name="zip" id="zip "class="input-text required-entry  custom-form-validation-zip-class " />

Note: You will know more about Magento & Download latest version of Magento from http://www.magentocommerce.com/

No comments:

Post a Comment