Re: Double click problem [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tedd wrote:
Hi gang:

This is probably trivial for most of you, but here's my solution to the problem I presented earlier.

The problem was, I just wanted to be certain that if a use clicked a button that they could only do it once. Sounds simple enough, huh?

Certainly, one can use javascript, but I wanted something that was basic php and html -- here's my solution with code (please provide critical review):

http://www.webbytedd.com/cc/submit-once/index.php

If the user clicks "Submit once", then that's the way it is until they quit their browser. If they don't quit their browser, then no amount of refresh will allow them to click the button again.

The "Reset Submit", of course, resets this condition but it's for demo purposes.

What I have not solved, and I don't think there is a solution (I could be wrong) is to prohibit the user from clicking the back button on their browser to reset this condition.

I've done a considerable amount of javascript reading, testing, and code search and have not found anything that works -- and -- I have even found places where the js community says that nothing will work to solve the back-button problem.

So, does anyone here know better? If so, please start a different thread.

Cheers,

tedd


It would require a little JS, but you could use the onUnload feature and pop up a warning that would tell them the problem(s) of leaving this page. Then use the confirm() method from JS to either allow or deny them to leave the current page.

I don't know if you can limit this action to only take affect when they press the back button, but it might help in any event.


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux