skip to Main Content

System allow to add single address multiple times.

 Step -
    → Login with valid user credential in magento frontend.
    → Tap on “Address book” from My Account.
    → Then click on “Add new address”.
    → Enter valid information in field and tap on “save” button more then one time.
    => System save same address multiple times.

can any buddy help me to solve this issue.. user should click only one time on save button..

2

Answers


  1. Chosen as BEST ANSWER

    This may help in future to someone else, user fill up valid value in form and only once he/she will be able to click on submit button.

    <script type="text/javascript">
        var dataForm = new VarienForm('my-form-id', true);   
    
        var formAlreadySubmitted = false;
        $j('#my-form-id').submit(function(e){
           if(dataForm.validator.validate()){
              if(formAlreadySubmitted){
                 e.preventDefault();
                    return false;
                 }
                 var submitChildren = $j(this).find('button[type=submit]');
                 submitChildren.attr('disabled', 'disabled');
                 submitChildren.addClass('disabled');
                 formAlreadySubmitted = true;
            }
        });
    
    //]]>
    </script>
    

  2. If you have customized it, try to check if there is multiple forms on that page.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search