O OuiKikUrAzz Senior member Sep 14, 2001 313 0 76 Jan 19, 2003 #1 how can i use js to make the submit button un pressable after it has been pushed so it can only be submitted once?
how can i use js to make the submit button un pressable after it has been pushed so it can only be submitted once?
O OuiKikUrAzz Senior member Sep 14, 2001 313 0 76 Jan 19, 2003 #3 Originally posted by: Argo document.formname.buttonname.disabled = true; Click to expand... err could you elaborate a bit more? Thanks
Originally posted by: Argo document.formname.buttonname.disabled = true; Click to expand... err could you elaborate a bit more? Thanks
A Argo Lifer Apr 8, 2000 10,045 0 0 Jan 20, 2003 #4 <form name="myform> <input name="mybutton" type="button" onClick=javascriptocument.myform.mybutton.disabled=true> </form>
<form name="myform> <input name="mybutton" type="button" onClick=javascriptocument.myform.mybutton.disabled=true> </form>
O OuiKikUrAzz Senior member Sep 14, 2001 313 0 76 Jan 20, 2003 #5 inputed it and when I click it it says document is undefined, i changed 'myform and myname' to appropriate values already.
inputed it and when I click it it says document is undefined, i changed 'myform and myname' to appropriate values already.
A Argo Lifer Apr 8, 2000 10,045 0 0 Jan 20, 2003 #6 In that case remove document alltogether. Just have javascript:formname.buttonname.disabled=true; Btw, this would work only in IE
In that case remove document alltogether. Just have javascript:formname.buttonname.disabled=true; Btw, this would work only in IE
O OuiKikUrAzz Senior member Sep 14, 2001 313 0 76 Jan 20, 2003 #7 ok that worked but when i push submit it just makes it unclickable and doesn't process the form
A Argo Lifer Apr 8, 2000 10,045 0 0 Jan 20, 2003 #8 Change the line to read this onClick=formname.buttonname.disabled=true;formname.submit();
S Shazam Golden Member Dec 15, 1999 1,136 1 0 Jan 20, 2003 #10 This actually works better: <input type="submit" onclick="javascript: this.disabled=true;"> If you use the submit() method, it will bypass any calls that are in the onsubmit event, which you may not want to do.
This actually works better: <input type="submit" onclick="javascript: this.disabled=true;"> If you use the submit() method, it will bypass any calls that are in the onsubmit event, which you may not want to do.
O OuiKikUrAzz Senior member Sep 14, 2001 313 0 76 Jan 20, 2003 #11 that method actually doesn't submit the form, it makes the button on pressable once and doesn't submit the form for processing
that method actually doesn't submit the form, it makes the button on pressable once and doesn't submit the form for processing