pm.
pm.

Reputation: 225

How do I disable form validation on Magento 1.4?

I'm experiencing validation errors in the checkout and user registration workflows of my Magento (version 1.4.2) install.

Example: During checkout, I get a "Customer email is required" error even if the field is correctly filled out. In the registration process, I get the error "Field xx must be greater or equal to a characters" It's interesting that it says "a" characters and not a specific number, but what does this refer to?

I want to figure out how to disable form validation so I can troubleshoot the problem and find out what is causing the errors.

Upvotes: 1

Views: 4136

Answers (2)

Jan Wy
Jan Wy

Reputation: 1569

If you want to disable the validation for a certain form field, you will have to remove the validation class of the input tag. The input tags are looking like this:

<input type="text" name="email" class="input-text validate-email required-entry" />

Just remove the "validate-email" part from the class attribute. Then this field will no longer be validated via JavaScript. To disable the Server-Side Validation for addresses you will have to override the Mage_Customer_Model_Address_Abstract::validate() function and add a "return true" to the beginning of the method. But I would not recommend that.

Upvotes: 1

Jonathan Day
Jonathan Day

Reputation: 18692

comment out the line in the specific phtml files inside the tags that looks like:

var dataForm = new VarienForm('name-of-form');

Otherwise, comment out the line in page.xml with:

<action method="addJs"><script>prototype/validation.js</script></action>

EDIT

open DOCROOT\js\prototype\validation.js and comment out the contents of validate (lines 124-155) and insert return true; instead if you want to bypass validation and submit the form.

HTH,
JD

Upvotes: 2

Related Questions