How to make sure that a form is not submitted twice?

Discussions

EJB design: How to make sure that a form is not submitted twice?

  1. Hai ! Can any one help me in solving this problem.

     Iam doing simple struts 1.1 application, Where I need to avoid form submitting twice.

      It is known that this can be solved using saveToken and isTokenValid methods , But the actual procedure is not known.

    Please help me in solving this problem.
  2. A simple solution is to disable the button upon submit.
  3. One solution is to call a javascript function
    Declare a variable outside and before the function with value 0
    Inside the function to check for the value of the variable to be 0 if so increment it to 1 and submit else if it is more than 0 donot submit

    Hope this helps
  4. One solution is on

    http://www.javaworld.com/javatips/jw-javatip136_p.html
  5. An easiest and simple solution is disable button when form is submitted.