PDA

Click to See Complete Forum and Search --> : Disabling submit button


Nov 20th, 2000, 10:33 AM
After someone presses the submit button, i want to disable it. How do i do that?

Nov 20th, 2000, 12:07 PM
I'm not sure if this is what you're after...

<INPUT TYPE="submit" onClick="this.disabled=true">

Paul

Nov 20th, 2000, 03:31 PM
I think thats javascript right, is there anyway to do it without a client side script? The site is done in PHP so if there is some way to do it in PHP, that would be great.

Nov 20th, 2000, 03:34 PM
Sorry, I don't know anything about PHP. Could your PHP script write the JavaScript for you? You could do a similar thing on load:

<BODY onLoad="frmWhatever.btnSubmit.disabled=true">

where...

<FORM NAME="frmWhatever">
<INPUT NAME="btnSubmit" TYPE="submit">
</FORM>


Paul

Nov 20th, 2000, 04:03 PM
The reason i dont want to use javascript, is cuz not everyone has javascript enabled. So if theres some way to do it in HTML or server side, then it will work with all browsers.

HarryW
Nov 20th, 2000, 07:17 PM
Well if you don't use client-side scripting then you have absolutely no control over the page the user is viewing unless they request something from you, which will happen when they click the submit button. You could do something in the page that the submit button submits to, but I don't quite know what you're doing so I can't really say much more about that.

da_silvy
Nov 23rd, 2000, 04:46 AM
you could have a normal button?

then have it check if it should submit or not?