how to prevent pressing submit more than one time?

Discussion in 'ASP General' started by dave, May 27, 2004.

  1. dave

    dave Guest

    Hi
    I have created asp pages to submit logs online.
    It is used generally to log from handset similar to
    iPAQ, Pocket PC.
    I have on html form and one submit button.
    On pressing submit , it redirects to other pages and
    inserts log into db.
    But the problem is when they press submit, it takes a
    little bit long to go next page so people press submit
    button 2-3 times and finally its insert duplicat records
    in the database.
    Can any one suggest me how to prevent this?
    Thanx
    dave
     
    dave, May 27, 2004
    #1
    1. Advertising

  2. dave

    dlbjr Guest

    Dave,

    Create a unique id to each form and hide in a hidden field. When submitted,
    check for a record with the form id. If no record then save the record with
    the form ID . If a record exist with the id don't save. When saved issue a
    new id to the form.

    -dlbjr

    Discerning resolutions for the alms
     
    dlbjr, May 27, 2004
    #2
    1. Advertising

  3. dave

    Lance Wynn Guest

    <form onSubmit="document.getElementByID('SubmitButtonID').disabled=true">

    Should work for most browsers (I typed this from memory, so it may be a
    little off), I'm not sure about PocketPC though.

    Lance


    "dave" <> wrote in message
    news:12f7401c4437f$6e971840$...
    Hi
    I have created asp pages to submit logs online.
    It is used generally to log from handset similar to
    iPAQ, Pocket PC.
    I have on html form and one submit button.
    On pressing submit , it redirects to other pages and
    inserts log into db.
    But the problem is when they press submit, it takes a
    little bit long to go next page so people press submit
    button 2-3 times and finally its insert duplicat records
    in the database.
    Can any one suggest me how to prevent this?
    Thanx
    dave
     
    Lance Wynn, May 27, 2004
    #3
  4. dave

    dave Guest

    I tried tht one
    But it doesnt work.
    It required IE4+ to disable submit button.
    Thanx
    dave
    >-----Original Message-----
    ><form onSubmit="document.getElementByID

    ('SubmitButtonID').disabled=true">
    >
    >Should work for most browsers (I typed this from memory,

    so it may be a
    >little off), I'm not sure about PocketPC though.
    >
    >Lance
    >
    >
    >"dave" <> wrote in

    message
    >news:12f7401c4437f$6e971840$...
    >Hi
    >I have created asp pages to submit logs online.
    >It is used generally to log from handset similar to
    >iPAQ, Pocket PC.
    >I have on html form and one submit button.
    >On pressing submit , it redirects to other pages and
    >inserts log into db.
    >But the problem is when they press submit, it takes a
    >little bit long to go next page so people press submit
    >button 2-3 times and finally its insert duplicat records
    >in the database.
    >Can any one suggest me how to prevent this?
    >Thanx
    >dave
    >
    >
    >.
    >
     
    dave, May 28, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Megha Vishwanath
    Replies:
    2
    Views:
    9,940
    tutorialsmaster
    Oct 2, 2009
  2. Merciadri Luca
    Replies:
    4
    Views:
    851
  3. Sivaswami Jeganathan

    how to handle more than one submit buttons

    Sivaswami Jeganathan, Mar 24, 2006, in forum: ASP General
    Replies:
    1
    Views:
    137
    Bob Barrows [MVP]
    Mar 24, 2006
  4. Steven D'Aprano
    Replies:
    0
    Views:
    143
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    116
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page