Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Submit

Status
Not open for further replies.

siuk

Programmer
Aug 23, 2001
38
0
0
GB
Hi,

I wonder if anyone can help me with this?

I want a form to only allow one submit, after this to stop any more submits. For example, if i press submit on my form, and then a second time - i want this second time to not submit the form, but continue with the 1st. Any ideas?

hope this makes sense!

Thanks
 
<script>
var submitted = false
function checkSubmit() {
if(!submitted) {
return true
}
return false
}
</script>

and then in your form tag put
onSubmit=&quot;return checkSubmit()&quot;

and that should stop poeple from mashing your form button
 
oppps. forgot something, silly me.

<script>
var submitted = false
function checkSubmit() {
if(!submitted) {
submitted = true
return true
}
return false
}
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top