How to Add Custom Validation and Field During Registration in Magento 1.9

magento-1.9

I would like to add a new custom validation and a custom field in the checkout process. When user registers he should be able to add his username along with other fields.

The validation for username is that it should be contain min 6 characters.

(In that is should have atleast 1 alphabet, 1 number & 1 special character) .

Thanks in advance

Best Answer

There is two think: First: Validation is done in front by JS - http://inchoo.net/magento/out-of-the-box-form-validation-in-magento/ You can use one predefined or add yourself.

Second: Validation from backend - Somebody ask how to add field to checkout.

Add new field in checkout

http://excellencemagentoblog.com/blog/2011/10/06/magento-add-custom-fields-checkout-page/

https://indiestechtips.wordpress.com/2011/07/30/how-to-add-custom-field-in-the-billing-and-shipping-address-of-onepage-checkout-in-magento/

Tips: It is just added new field in backend. In frontend it is just array of fields so adding one isn't complicated.

Related Topic