Submit form once, disable submit, then go back & enable it??

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ShadowIce
Forum Commoner
Posts: 75
Joined: Tue Jan 12, 2010 8:43 am

Submit form once, disable submit, then go back & enable it??

Post by ShadowIce »

How can I make this code disable the submit button once it has been pressed, then if the user hits back or GOES back, it will re-enable it again?

Code: Select all

<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
 
function formControl(submitted) 
{
   if(submitted=="1") 
    {
   commentForm.Submit.disabled=true
   alert("Thanks for your comments!")
    }
}
 
</SCRIPT>
Thanks!

ShadowIce~
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Submit form once, disable submit, then go back & enable it??

Post by Christopher »

Is the form redirected to a different page when successfully submitted? Or does it stay on the same page?
(#10850)
ShadowIce
Forum Commoner
Posts: 75
Joined: Tue Jan 12, 2010 8:43 am

Re: Submit form once, disable submit, then go back & enable it??

Post by ShadowIce »

It's redirected to a different page
Post Reply