Magento form submit button needed double click to submit

1.6k Views Asked by At

I am facing Strange behavior of submit button in magento. In cusotmer registration page, when one of the registraion field like lastname is not field and click submit button, I get validation error, its right up to here. But when I go and fill the lastname and directly click to submit button, the button moves up without submitting and when I click to it again, it gets submitted.

It because error div disappears because of which the button moves up but why the button is not accepting click event and submit the form when all form validation is ok.

The code is exactly same with register.phtml of template/customer/account/register.phtml

Looking forward to hear from you guys.

Thanks

2

There are 2 best solutions below

2
On

Adjust the CSS of the error div to make it float above the page, that way it won't affect the layout as it appears and disappears.

.validation-advice {
    position: absolute;
    z-index: 10;
    left: 1em;
    top: 1em;
}
0
On

In between following works for me.

jQuery(function($){ $('#btn_create_account').mousedown(function() {

          var signupForm = new Validation('form-validate');
          var result = signupForm.validate();
          if(result == true) {
              $('#form-validate').submit();
              return true;
          }
          else
                return false;

        });

    });