Entry
How can is stop a user from pressing the submit button twice on a php/mysql data entry form?
Dec 3rd, 2006 18:09
Jorge Cordero, Tobias Mitter, Chris Kings-Lynne, Monte Ohrt, steve moffat, Ben Udall, jorge@delahorro.com
HIDDING USING JAVASCRIPT
To stop this to happen you can change the visibility property to false
or hidden that way the button wont show anymore
that way the user doesnt get confused clicking again
(this is not to prevent when the user hits the back Button)
<html>
[...]
<script language:"javaScript">
function hideMybutton(){
var myForm = document.formName;
myForm.mySubmitbutton.style.visibility="hidden";
alert("The Form has been sent please wait");
}
</script>
<body id="b1">
[...]
<form name="formName">
<input type="button" value=" submit "
onClick="hideMybutton();" name="mySubmitbutton">
</form>
[...]
</body>
</html>
have fun
Jorge