permanetly disable submit button
Moderator: General Moderators
permanetly disable submit button
how do i permanently disable a submit button in php so that even if the user refreshes the page it will remain disabled
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: permanetly disable submit button
if you want to disable a submit button you dont need php just use disabled in html.
i.e.
i.e.
Code: Select all
<input type='submit' disabled='disabled' value='submit' name='submit' id='submit' /> <!-- W3C strict -->Re: permanetly disable submit button
If it's permanent, why even have the submit button in there at all?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: permanetly disable submit button
To mock them stupid users trying angrily to click on the button!
Seriously though, reading into his question he probably disables the button in javascript but somehow wishes to persist that state through PHP (via AJAX maybe?)
Didn't give enough detail
Seriously though, reading into his question he probably disables the button in javascript but somehow wishes to persist that state through PHP (via AJAX maybe?)
Didn't give enough detail
-
mattpointblank
- Forum Contributor
- Posts: 304
- Joined: Tue Dec 23, 2008 6:29 am
Re: permanetly disable submit button
Be careful with this though - if the form's never meant to be submitted, don't add a button, even one disabled like people have suggested. Tools like the Firefox Web Developer toolbar can enable disabled buttons...
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: permanetly disable submit button
I think he means after the form has been submitted, to disable the button. To do it that way, you would have to set a session variable, so if the user returns to that page they can not resend the form - this is not full proof as they can clear their browser cache and resent the form.