Multiple Submits

Results 1 to 3 of 3

Thread: Multiple Submits

  1. #1
    JustinS Guest

    Default Multiple Submits

    Hiyas all,<BR><BR>Earlier I accidentally double-clicked on a "Submit" button on one of my ASPs, and noticed that the data being submitted was submitted twice (to an MS Access database) - Does anyone know of a good way to stop this? (other than not clicking twice) ;)<BR><BR>Thanks in advance,<BR><BR>Justin

  2. #2
    Join Date
    Dec 1969

    Default RE: Multiple Submits

    In the function(or page), that is being call by on_click event, the first thing you would do is something like that:<BR><BR>If bAllowClick then<BR> bAllowClick = false<BR> ...Do whatever you need to do on click<BR> bAllowClick = true<BR>End if<BR>The other thing you could do is to check if the record identical to one that you&#039re saving already exists on the table, or the date of it is within few seconds of you record, then either skip over update part, or throw some kind of msg.<BR>

  3. #3
    Michael Swanson Guest

    Default RE: Multiple Submits

    I&#039ve tried a number of different techniques, and the one that seems to be easy to implement--while not very expensive--is to generate a random transaction ID string and store it with the data. Before you write something to the database, search for the transaction ID number (and some other piece of information). If it already exists, chances are *extremely* good that your data has already been written.<BR><BR>For most uses, this is fine. For mission critical stuff, the 0.0001% of the time this fails might not be acceptable. At that point, the expense of a more sophisticated check is certainly worth it.<BR><BR>Michael Swanson, MCSE, MCP+Internet<BR>Webmaster<BR>Donnelly Corporation<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts