Topics: 15 | Posts: 10 | Comments: 12 | Members: 151
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.
replies