Results 1 to 3 of 3
  1. #1
    WTF Groupie Array
    Join Date
    Jun 2008
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What do you guys recommend for making sure a form is not submitted twice?

    What do you guys recommend for making sure a form is not submitted twice? I can hit the "Enter" key quickly twice in a row and it submits the form twice.

  2. #2
    tex
    tex is offline
    WTF Groupie Array
    Join Date
    Sep 2010
    Posts
    1,041
    Thanks
    7
    Thanked 35 Times in 25 Posts


    Disable submit as the first item of submiting a form with jquery.

  3. #3
    WTF Groupie Array
    Join Date
    Oct 2011
    Posts
    349
    Thanks
    0
    Thanked 2 Times in 2 Posts


    Quote Originally Posted by zaazxdfgcdc View Post
    What do you guys recommend for making sure a form is not submitted twice? I can hit the "Enter" key quickly twice in a row and it submits the form twice.

    try to add a flag variable..


    HTML Code:
    <script type="text/javascript">
    
    var form_flag = 0;
    
    </script>
    
    
    <form ... onsubmit="form_flag++; return form_flag==1?true:false;">
    
    ...
    
    </form>


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •