Disable Submit Button after one click with validation?

后端 未结 2 1556
名媛妹妹
名媛妹妹 2020-12-17 06:07

I have a form that is passing data to a cc processing terminal, as well as writing PDF contracts and receipts. There is validation built into the form, and I am trying to ad

2条回答
  •  心在旅途
    2020-12-17 06:33

    You can you if you are using jQuery form validator

    $(document).ready(function () {
        $("#addOfficerForm").submit(function () {
            var total_error = document.querySelectorAll('.error').length;
            if(total_error === 0){
                document.getElementById("checkEditRestriction").disabled = 'true';
            }  
        });
    });
    

提交回复
热议问题