Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. common problem, multiple clicks

common problem, multiple clicks

Scheduled Pinned Locked Moved Web Development
helpjavascriptquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    r i s h a b h s
    wrote on last edited by
    #1

    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.

    P J T 3 Replies Last reply
    0
    • R r i s h a b h s

      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.

      P Offline
      P Offline
      Paul Watson
      wrote on last edited by
      #2

      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...

      1 Reply Last reply
      0
      • R r i s h a b h s

        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.

        J Offline
        J Offline
        Jonathan Craig
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • R r i s h a b h s

          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.

          T Offline
          T Offline
          Terry ONolley
          wrote on last edited by
          #4

          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.

          R 1 Reply Last reply
          0
          • T Terry ONolley

            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.

            R Offline
            R Offline
            r i s h a b h s
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups