Forum Moderators: open

Message Too Old, No Replies

How to totally disabled a submit button on next visit?

         

appletea

8:14 pm on Jul 17, 2010 (gmt 0)

10+ Year Member



Hi,

May I know how to totally disable a submit button after a user click on it.This means that even after his next visit,once he submitted the form on his previous visit, he could not submit it again.By the way I am using session too.So far ,I have researched online and found this code: document.getElementById('Submit').disabled=true.
This disabled the button when clicking on it but after refrshing/the user when back to the same link on his next visit, the submit button is still enable.I have tried onsubmit too.But it's not working. Any suggestion? Thanks.

lammert

6:08 am on Jul 18, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To make a fool-proof solution, I would rather do something server side. If a session variable exists which tells server side script (PHP, ASP or whatever) that the button on the page has been pressed previously, then the button should be removed from the page when the page is resent to the visitor, or at least grayed out.

appletea

12:29 pm on Jul 18, 2010 (gmt 0)

10+ Year Member



Hi lammert,

The suggestion that u suggested is what I'm trying to do.So i would be using function right?Is it also using the disabled button function?I have tried it but it seem to disable only when the form is submitting,but when I refresh/reload the page, the submit button is still being enable.Am I missing some codes or is there another javascript button function that would allow it to be greyed totally on the next visit?Sorry to trouble you.I'm still learning abt PHP and javascript.