How do I add STOP Multiple Form Submit with JQuery Validation

前端 未结 4 1279
小鲜肉
小鲜肉 2020-12-20 10:12

I would like to stop disable submit button once validation is completed and form is submitting so I will not have multiple inserts to DB. I have not updated post with full f

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-20 11:03

    Simplest method that should work everywhere, obviously you would run your code and re-enable it if necessary:

    $(document).ready(function(){
        $("#submitBtn").on("click",function(){
            $(this).attr("disabled","disabled");
        });
    });
    

    http://jsfiddle.net/calder12/8Syrh/1/

提交回复
热议问题