I need to disable validation for few customer address fields in customer/account/create/ (but only on this page).

Seems like I've messed up with names and can't find out how to fix my code. Folder structure:




The validate() function will be overridden in Address.php

public function validate()
   // my validation 

By filling form under customer/account/create/, even if I've removed 'required' class in form and removed in customer_register_address customer_form_attribute for every attribute_id I don't need @ registration page (e.g. street, city etc.), I still got validation warning message:

Please enter the street.
Please enter the city.

3 Answers 3


So this is true for Magento 1.9 but I am not sure about the others.

  1. These attributes will be set as required on the table eav_attribute so what you can do here is create a setup script that updates the attributes so that they are not required.
  2. Perform a rewrite of the model Mage_Customer_Model_Address and rewrite the function _basicCheck. Then include or only the validation that your required. For versions 1.8 and lower you will need to rewrite the function validate.

If you see a VarienForm() being run on the page somewhere, it will instantiate the Prototype validation. It is usually in the format var foobar = new VarienForm('foobar-form'); where <form id="foobar-form"...

It should be safe to comment out this function being called if you want to create your own with your own Javascript validation.

  • I still want to validate Phone number there. That's why I said "few fields". Actually I'd like to override Mage/Customer/Model/Adress/Abstract.php function validate() where you got these fields: if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) { $errors[] = $helper->__('Please enter the city.'); }
    – Alex
    Oct 31, 2013 at 9:09

For client side only, simply remove class "required-entry" from input element that you don't want any Javascript form validation.

With input validation:

<input id="firstname" class="input-text required-entry" type="text" maxlength="255" title="First Name" value="" name="firstname"></input>


<input id="firstname" class="input-text" type="text" maxlength="255" title="First Name" value="" name="firstname"></input>
  • 1
    this won't work because the address is validated server side also.
    – Marius
    Nov 8, 2013 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.