Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP - Prevention of Multiple (re)Submissions

Posted on 2003-03-10
9
Medium Priority
?
259 Views
Last Modified: 2010-04-06
I have a couple forms where people use the "back" button to review their data after submission ... they do this 20 or 30 times producing either data corruption or duplicate records (in SQL2000).  Any ideas on managing this?  I'm using regular ASP, ADO, session objects, and SQL2000 running on a Windows2000 server.

Thanks in advance,

lance22
--------------
0
Comment
Question by:lance22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 6

Expert Comment

by:thomasdodds
ID: 8104283
wrap your data insertions with a check for existing data (which unfortunately makes another trip to your db) include a flag in your QueryString to perform the submission processing that way you can control the action ...
0
 
LVL 6

Accepted Solution

by:
thomasdodds earned 1000 total points
ID: 8104287
that should be:

EITHER wrap your data insertions with a check for existing data (which unfortunately makes another trip to your db) OR include a flag in your QueryString to perform the submission processing that way you can control the action ...
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8105328
Here is a very similar question, with a couple of different ways to deal with your problem:

http://www.experts-exchange.com/Web/WebDevSoftware/FrontPage/Q_20540106.html

CR
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Expert Comment

by:Hummusx
ID: 8105396
Another possibility would be to stick a value in the session indicating whether or not the user had already submitted it.  The best way to do this would probably be to store the primary key from the record that was inserted when they submitted it.  Then when they tried to submit it the second time, the submission page could check the session for the key, delete the first record, insert the updated record, and store the new key in the session.  Alternatively, it could just call update on the old record instead of delete/insert.  I'm not sure what your data looks like, so I can't be sure what would be the best choice.

In any case, it seems like that would be more beneficial to the user than just blocking them from submitting it again.  You'll get the most recent 'version' that they tried to submit.
0
 
LVL 4

Expert Comment

by:iozturk
ID: 8106404
1. Try writing a Jscript that clears the form in every form load.

2. Give the user an ID when he/she enters the web site record it in session object and check if he/she made update

3. (This is not recommended by Microsoft and others) put your connection in session object and close it when you want.
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8106545
Hummmsx,

Check the referenced question from my post... a far easier way to deal with it by using session variables.

iozturk,

#1- Try:

<body onLoad="document.form1.reset();">

#2- Covered in the referenced question from my post...

#3- I'm not even going there...

CR
0
 
LVL 2

Expert Comment

by:Hummusx
ID: 8106577
Actually CRagsdell, I feel that the solution I suggested would be preferable over what you suggested in the other thread.  What if the user would like to change their option?  The reason they are hitting the back button is because they wanted to change something that they previously submitted.  In your suggested solution, you simply deny the user the ability to make changes.

The solution I proposed allows the user to make changes, resubmit the form, and know that their most up-to-date info was recorded in the database.  It might be very slightly "harder" than what you proposed, but it's much better for the end user, which is usually who we are trying to build these sites for.
0
 

Author Comment

by:lance22
ID: 8106636
I appreciate all the feeback as all of it was good.  In the end, I went with checking new submissions against identical records ... not easy as many of these records are scientific field tests which are nearly identical to begin with.  Thank you all very much.
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8106733
Hummusx,

Sorry, but you evidently didn't review my sample very carefully. In my sample the user has a chance to change his form submission in the confirmation... with no need to hit the back button. Like you said, make it easier for the user...

CR
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question