#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Prevent multiple form submissions


    Hey Dev Shed,

    I am working on a solutions to prevent the user from submitting multiple form. I wrote this little jquery function to try to stop it. Not sure why it is not working.

    Code:
    	
    <script>
       $(document).ready(function(){
          $("form").submit(function(e){
             e.preventDefault();
           });
    </script>
    Is there a simple reusable bit of code I can use to achieve this?

    Thanks!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    300
    Rep Power
    9
    Good morning bennydev,

    You could set the submit button to be disabled once it has been clicked. That will prevent the user from being able to submit the form multiple times.

    Does the page reload?

    Regards,

    NM.

IMN logo majestic logo threadwatch logo seochat tools logo