3

I want to check if all the validations are passed in magento billing form

what i have tried is

<script type="text/javascript">

    //<![CDATA[    
    var billingForm = new VarienForm('co-billing-form', true);
            if (billingForm.validator && billingForm.validator.validate())
            {
              //do the stuff
            }
     //]]>
    </script>

But it always returns true , even if all the validations are not passed ,

When i alerted the billingForm.validator.validate() it returns true .

how to get over it ?

2

This should be enough as this is what happens when the form is submitted.

submit : function(url){
    if(this.validator && this.validator.validate()){
         this.form.submit();
    }
    return false;
},

I would suggest that the validation is either set-up on items outside of the form or the validation is actually passing.

| improve this answer | |
  • oaky , here co-billing-form is the billing form id , but its always returns true even filed are not validated – KTM Apr 24 '15 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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