Login

Username or Password is Incorrect!
Enter your Username and Password!

Username

Password

Forgot passsword?

Topics: 15   |   Posts: 10   |   Comments: 12   |   Members: 151

  • 2
  • 0

Disabling Duplicate Form Data on Submission

omari Wed Mar 21, 2012 - 01:54 pm

Omari Celestine

If you utilize forms on your website and want to ensure that there are no duplicate entries on a single submission, then you can use this simple code.


<!-- to be placed on the button relative to it href -->
onsubmit="this.disabled='disabled';"



What this operator does is it disables the button once it has been clicked disabling duplicate submissions.

Here is a sample utilization of the code.


<form method="post" action="/location/to/form-handler.php">
<br />    <input type="text" name="my-text" value="">
<br />    <textarea name="description" cols="50" rows="20"></textarea>
<br />    <button type="submit" onclick="this.disabled='disabled';">Submit</button>
</form>



It can be user in various ways utilizing additional methods but this is just one of the simplest methods.

0 ATTACHMENTS

Login or Register to leave a comment.

Topic Search
Get Started