Magento – Change Validation for Registration Form

form-validationformsmagento-1.9register

I want to change the firstname and lastname field validation in registration form.

I want first name and last name should be only characters with maxlength 15.

And in which file I can find the code for first name and last name.

How can I?

Best Answer

You need to change in below files for validation of firstname and last name

Copy file from

app/design/frontend/base/default/template/customer/widget/name.phtml

to

app/design/frontend/Your-Theme/Your-Package/template/customer/widget/name.phtml

change as per your requirement

add validation in

js/prototype/validation.js

I suggest you to add validation add your own class to that field and create validation for it.