disabling the submit button after click

W

Willie

Hi All;

I have a form with multiple buttons and I would like to disable the buttons
after the user clicks on the button to prevent multiple submitions.

<input type="submit" name="return1" value="Send To MFG" id="return1"
onClick='this.disabled=true;this.form.submit()' >

This works but I do not get the return1 value passed to the action script as
I do if I just have :

<input type="submit" name="return1" value="Send To MFG" id="return1" >

I need this vale to be know which button was pushed. Is there a way of
passing a value with the form.submit() ?

Thanks
Willie
 
S

scripts.contact

I have a form with multiple buttons and I would like to disable the buttons
after the user clicks on the button to prevent multiple submitions.

<input type="submit" name="return1" value="Send To MFG" id="return1"
onClick='this.disabled=true;this.form.submit()' >

This works but I do not get the return1 value passed to the action script


Disable it after submitting :
<input type="submit" name="return1" value="Send To MFG"
onClick='this.form.submit();this.disabled=true;return false' >

OR

<form ... onsubmit="this.return1.disabled=1">
....
<input type="submit" name="return1">
</form>
 
D

David Mark

Disable it after submitting :
<input type="submit" name="return1" value="Send To MFG"
onClick='this.form.submit();this.disabled=true;return false' >

OR

<form ... onsubmit="this.return1.disabled=1">
...
<input type="submit" name="return1">
</form>

For some reason the OP wants to disable only one of the multiple
submit buttons, so the second example won't work.
 
E

Evertjan.

David Mark wrote on 16 jul 2007 in comp.lang.javascript:
For some reason the OP wants to disable only one of the multiple
submit buttons, so the second example won't work.

Why? I think it will.
 
D

David Mark

David Mark wrote on 16 jul 2007 in comp.lang.javascript:



Why? I think it will.

You think it will do what? It will disable just the return1 button,
which may or may not be the one that was clicked.
 
E

Evertjan.

David Mark wrote on 16 jul 2007 in comp.lang.javascript:
You think it will do what? It will disable just the return1 button,
which may or may not be the one that was clicked.

Yes, "OP wants to disable only one of the multiple submit buttons".

I think the whole idea is aweful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top