Web Layout
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsWeb DesignWeb Layout

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 5th, 2004, 01:05 PM
rahulgup rahulgup is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 rahulgup User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Avoid form resubmission when REFRESH clicked

I am working with website in which a user can login and then submit some forms. I want the user to avoid re-submitting the same form twice when he uses the browser refresh or when he goes to another page and then comes back to that same page using the browser back button.

I know of two solutions:
1. Redirect to a different page after form submission - The problem with this approach is that the website has many forms. So redirecting each form to a different one is not a very feasible solution.
2. A token can be stored in session (or somewhere) after each form submission. These tokens can be verified if the form is being resubmitted - The problem with this approach is that the user can submit one form only once. I want the user to be able to submit the same form multiple times, provided with different data.

Is there a suitable solution where a form with same data is submitted only once, but there is no such restriction with different data? (Storing ALL the information filled in each form during that session and then comparing for resubmit is not a clean solution I think??).

Thanks.

Reply With Quote
  #2  
Old February 27th, 2004, 11:52 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
Maybe you could store the info in a cookie. Then, when the user posts the form, read the cookie contents to see if he/she has already posted the same information once. If so, don't process the form. Display a message.

Does this help?

Reply With Quote
  #3  
Old June 12th, 2004, 10:51 AM
Matrix28 Matrix28 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 51 Matrix28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 sec
Reputation Power: 6
Use a redirect on the sumission page.

Reply With Quote
  #4  
Old November 3rd, 2004, 10:51 AM
maxwell_hung maxwell_hung is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 maxwell_hung User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
On each form create a hidden field that holds a randomly generated string.
When the user submits the form store this id in an array and save it as a session variable.

If the the incoming posted form id against this array to see if that instance of the form has been posted before. As the form id is random it won't stop users filling in the form again and posting it, just stop them from resubmitting the same form.

Reply With Quote
  #5  
Old November 7th, 2004, 12:41 PM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
Quote:
Originally Posted by dcarva
Maybe you could store the info in a cookie. Then, when the user posts the form, read the cookie contents to see if he/she has already posted the same information once. If so, don't process the form. Display a message.

Does this help?


This is what I do for my company's forms and it works well. Gives the added control over the content being submitted.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.


Reply With Quote
  #6  
Old March 22nd, 2005, 02:46 PM
mike91 mike91 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 mike91 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 0
Smile use a hidden field with the current URL

Use a hidden field call it "redirectMeToWhereICameFrom" and then get the current URL

<%=(request.servervariables("URL"))%> then whereever you are posting your form,
when you've done whats needed to be done i.e. added shopping cart content or dropped the details into a DB use a simple

<% response.redirct(request.form("redirectMeToWhereICameFrom"))%>

Simple

Reply With Quote
Reply

Viewing: ASP Free ForumsWeb DesignWeb Layout > Avoid form resubmission when REFRESH clicked


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT