Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > disabling the submit button after click

Reply
Thread Tools

disabling the submit button after click

 
 
Willie
Guest
Posts: n/a
 
      07-10-2007
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


 
Reply With Quote
 
 
 
 
scripts.contact
Guest
Posts: n/a
 
      07-15-2007
On Jul 10, 2:36 pm, "Willie" <(E-Mail Removed)> wrote:
> 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;ret urn false' >

OR

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




 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      07-16-2007
On Jul 15, 5:57 pm, "scripts.contact" <(E-Mail Removed)>
wrote:
> On Jul 10, 2:36 pm, "Willie" <(E-Mail Removed)> wrote:
>
> > 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;ret urn 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.

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      07-16-2007
David Mark wrote on 16 jul 2007 in comp.lang.javascript:

>> <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.
>


Why? I think it will.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      07-16-2007
On Jul 16, 5:18 pm, "Evertjan." <(E-Mail Removed)> wrote:
> David Mark wrote on 16 jul 2007 in comp.lang.javascript:
>
> >> <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.

>
> 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.

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      07-16-2007
David Mark wrote on 16 jul 2007 in comp.lang.javascript:

> On Jul 16, 5:18 pm, "Evertjan." <(E-Mail Removed)> wrote:
>> David Mark wrote on 16 jul 2007 in comp.lang.javascript:
>>
>> >> <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.

>>
>> 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.


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

I think the whole idea is aweful.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable submit button after user click GS ASP .Net 11 05-14-2011 02:06 PM
JSF life cycle gets interrupted when disabling a button after a submit call. jeffotn@gmail.com Java 3 11-06-2007 06:30 PM
Disable submit button after click but fire validators? Chris Ashley ASP .Net 1 12-16-2005 11:39 AM
Preventing Multiple submit (Disabling Submit Button Post Click) Solution Mark ASP .Net 1 12-13-2004 08:03 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM



Advertisments