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!

Disable Submit after submitted

Status
Not open for further replies.

schase

Technical User
Sep 7, 2001
1,756
0
0
US
Hi all,

I have a user who just loves to press Submit until it goes on through. Problem is it resubmits the form each time - and uploads more images - shoots back to a different server and completes a database update/insert.

Is there a way to disable submit after it is pressed once and submitted?

Thank you "Never underestimate the power of determination"

Stuart
 
Code:
onclick=&quot;<documentName>.<FormName>.<SubmitButtonID>.disabled='true'&quot;

And then, when you've completed all the whangdoodling you need to do, the very last command you send is...

Code:
<documentName>.<FormName>.<SubmitButtonID>.disabled='false'

Good luck!

Edward &quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Hi Edward,
Thank you for your reply.

I get a document is undefined - earlier I put in my page name and it also showed up as undefined.

this is my submit button code.

<input name=&quot;Finish&quot; id=&quot;FINISH&quot; type=&quot;submit&quot; class=&quot;inputsubmit&quot; value=&quot;Finish&quot; onclick=&quot;Document.form1.FINISH.disabled='true'&quot;>

&quot;Never underestimate the power of determination&quot;

Stuart
 
<form name='form1'>
<input type=&quot;submit&quot; id=&quot;FINISH&quot; value=&quot;Submit&quot; onClick=&quot;javascript:document.form1.FINISH.disabled=true;return false;&quot;>
</form>
 
lol got it covered on the other thread LAwebTek - but thank you for your reply. &quot;Never underestimate the power of determination&quot;

Stuart
 
oops, I made the same mistake, have to tell it to submit the form, too - lol:

<form name='form1'>
<input type=&quot;submit&quot; id=&quot;FINISH&quot; value=&quot;Submit&quot; onClick=&quot;javascript:document.form1.FINISH.disabled=true;document.form1.submit();return false;&quot;>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top