How To Disable Submit Button After Form Submission In PHP?


I will help you with how to disable the submit button after click in jquery PHP. we can prevent click submit button in jquery HTML. So that it will help you to disable submit button after click in PHP, Laravel, Codeigniter, etc project that use jquery.

At some point, we need to forestall an excessive number of snaps on submit button. in the event that you are chipping away at register structure with php, at that point it may be require some investment to submit structure due to long procedures of submit page. Be that as it may, in the event that client have server issue or Internet issue and so forth, at that point he will simply click over and over. So may it can make issue structure us. so essentially you should forestall it by utilizing crippled submit button after a single tick utilizing jquery.

Here bellow simple example will help you to resolved your problem by using bellow example. You can see full example so that can help you in your php project.

Example
<!DOCTYPE html>
<html>
<head>
    <title>How to Disable Submit Button After Form Submission in PHP?</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
   
<form action="" method="POST" id="m-form">
    <input type="text" name="name" placeholder="Name"> <br> <br>
    <input type="text" name="email" placeholder="Email Id"> <br> <br>
   
    <button type="submit" id="b-submit">Submit</button>
</form>
    
<script type="text/javascript">
   
    $(document).ready(function () {
    
        $("#m-form").submit(function (e) {
   
            $("#b-submit").attr("disabled", true);
   
            return true;

    
        });
    });
    
</script>
   
</body>
</html>
Demo
How To Disable Submit Button After Form Submission In PHP?

I hope it can help you...

  1. This website is shearing nice valuable content . I will implement this code in my website . its very helpful for my website design. Again thank you for this information. keep this work up.

Leave a Reply

Your privacy will not be published. Required fields are marked *

We'll share your Website Only Trusted.!!

close