Javascript DOM Form Preventing Double Submit

Description

Javascript DOM Form Preventing Double Submit

View in separate window


<html>
<head>
  <title>Preventing double-submit</title>
</head>/*from w ww  .  j a  va  2  s .c  o  m*/
<body>
  <form action="signup.php" onsubmit="return false;" name="signupForm">
  Text: <input type=text>
  <input type=button onclick="this.disabled=true; this.form.submit();" value="Submit">
  </form>
  <script type="text/javascript">
  document.signupForm.elements[document.signupForm.elements.length-1].disabled=false;
  </script>
</body>
</html>



PreviousNext

Related