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. ASP.NET
  4. How to handle multiple submit button clicks?

How to handle multiple submit button clicks?

Scheduled Pinned Locked Moved ASP.NET
javascriptdatabasetutorialquestion
2 Posts 2 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.
  • B Offline
    B Offline
    Barry Etter
    wrote on last edited by
    #1

    I know I'm missing something simple here, but what's the cleanest way to handle impatient users who think they need to click a "submit" button over and over again on a web form? On some of my pages, this causes multiple transactions to be sent to my database. :mad: Currently, I have an ugly bit of JavaScript that hides the button once it's clicked (via a DHTML behaviour). I tried setting the "disabled=true", but then the Form is never submitted. :confused: Thanks for your advise. Barry Etter

    U 1 Reply Last reply
    0
    • B Barry Etter

      I know I'm missing something simple here, but what's the cleanest way to handle impatient users who think they need to click a "submit" button over and over again on a web form? On some of my pages, this causes multiple transactions to be sent to my database. :mad: Currently, I have an ugly bit of JavaScript that hides the button once it's clicked (via a DHTML behaviour). I tried setting the "disabled=true", but then the Form is never submitted. :confused: Thanks for your advise. Barry Etter

      U Offline
      U Offline
      User 642242
      wrote on last edited by
      #2

      Add an onsubmit handler to the form that checks a variable to see if the form has been submitted before. If it has, just cancel the submit event buy setting the event.returnValue = false in IE, for Netscape - I thinkyou just return false within the event handler.

      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