common problem, multiple clicks
-
Dear All, the problem i'm facing is a very common one tht most of us encounter. I want to prevent multiple clicks of a button on my asp page. I tried to solve this using javascript by using a flag, but the problem is tht the page gets reloaded and the variable gets re-initialized. Is there any other way to do this? Can it be done using asp? Plz help! ____________________________________________________________ rishabhs I think therefore I am.
-
Dear All, the problem i'm facing is a very common one tht most of us encounter. I want to prevent multiple clicks of a button on my asp page. I tried to solve this using javascript by using a flag, but the problem is tht the page gets reloaded and the variable gets re-initialized. Is there any other way to do this? Can it be done using asp? Plz help! ____________________________________________________________ rishabhs I think therefore I am.
I don't exactly know what you want to do but here is my stab at a solution. 1. On the first click of the button you want it to become disabled to prevent the user clicking it again. So use JavaScript to set the button to disabled. That bit you seem to have sorted. 2. Using ASP, on post-back of the page set a cookie 3. On the same page check for the cookie. If it exists then either using JavaScript or ASP set the button to disabled. The user could clear their cookie cache and then you will be back to square one. But there is no guaranteed method of permanently disabling a button. regards, Paul Watson Bluegrass South Africa Christopher Duncan quoted: "...that would require my explaining Einstein's Fear of Relatives" Crikey! ain't life grand? Einstein says...
-
Dear All, the problem i'm facing is a very common one tht most of us encounter. I want to prevent multiple clicks of a button on my asp page. I tried to solve this using javascript by using a flag, but the problem is tht the page gets reloaded and the variable gets re-initialized. Is there any other way to do this? Can it be done using asp? Plz help! ____________________________________________________________ rishabhs I think therefore I am.
r i s h a b h s, Paul's has a good solution. If you don't want to use a cookie you can do something like this on the postback: ---- ASP Code ------------
dim sBtnDisabled
sBtnDisabled = ""if Request.Form("submit") = "Submit" then
sBtnDisabled = "disabled"
end if--- HTML Code ------------
>
Good Luck :) Jonathan Craig mcw-tech.com
-
Dear All, the problem i'm facing is a very common one tht most of us encounter. I want to prevent multiple clicks of a button on my asp page. I tried to solve this using javascript by using a flag, but the problem is tht the page gets reloaded and the variable gets re-initialized. Is there any other way to do this? Can it be done using asp? Plz help! ____________________________________________________________ rishabhs I think therefore I am.
If the form is small enough then you can use this technique. Instead of making the button type=submit, just have it mapped to a javascript function which builds the URL from the form variables. The first line of code in the javascript function should be to disable the button.
-
If the form is small enough then you can use this technique. Instead of making the button type=submit, just have it mapped to a javascript function which builds the URL from the form variables. The first line of code in the javascript function should be to disable the button.
Thnx guyz I've uses a flag (counter) to check multiple clicks. The function returns without processing if counter exceeds 1. i hope this works. ____________________________________________________________ rishabhs I think therefore I am.