PLEASE HELP: How do i get old form data EVEN AFTE

Results 1 to 3 of 3

Thread: PLEASE HELP: How do i get old form data EVEN AFTE

  1. #1
    Robin Reyes Guest

    Default PLEASE HELP: How do i get old form data EVEN AFTE

    Hi,<BR><BR>First picture this: I am building a site with a form, and in that form a person may enter his/her data. To recognize the user throughout the site, I store a session variable called Session("UserID") which is a user_id value coming from a database.<BR><BR>Important note: Sometimes a person doesn&#039;t finish entering in ALL of their data for hours and hours because they keep leaving their computer and coming back to their computer to fill in more values, so eventually that session variable, Session("UserID"), usually expires.<BR><BR>What I did: When a user clicks "SUBMIT" and their session variable is expired, I redirect them to a security.asp page that forces him/her to re-enter his/her uesrname and password in order to get Session("UserID") again from the database.<BR><BR>The problem: After Session("UserID") is set, I redirect them back to the page and the form they were originally working on, however all the textboxes are EMPTY instead of containing the values they previously had before the page expired!!!!<BR><BR>My question/problem: I wanted to know if there is a way after i redirect the user back to the form they were filling out (using javascript history.go(-n) and using a regular response.redirect) to have the previous values still filled in (so that the textboxes aren&#039;t empty as if there was never any data at all). I keep getting the "Warning: This page has expired" problem and then I can never get that form information back. Hence, the user wasted a couple of hours entering information he/she couldn&#039;t even save.<BR><BR>My thoughts: If caching and shutting off the page expiration is the way to do this, please let me know how to do it. Also, if there is a way to just have session variables never expire after 3, 10, or 20 minutes that would do the trick as well because the expiration of session variables is how I got this problem in the first place. And when I handled the session variables by creating the security page, I ran into the problem of providing the user with all their previous data that they had entered into the form.<BR><BR>PLEASE HELP if you can show me the light. It&#039;d be greatly appreciated. Thanks.<BR><BR>-Robin

  2. #2
    Join Date
    Dec 1969

    Default a couple of ways

    You can <BR>a) put the session variable in a cookie instead.<BR>b) when they submit, and you detect that they timed out, use server.transfer to redirect them to the login page. On this page, loop through the form collection and write the values to hidden fields, then when they log in, server.transfer them to the form page, which will be set up to collect all of the hidden variables to repopulate the form. This will work because server.transfer insures that the receiving page has the collections availible to the sending page. i.e. login.asp will have the form collection from the form page, and the form page will have the form collection from login.asp.

  3. #3
    Join Date
    Dec 1969

    Default Similar question

    I have a similar question. I have a data entry form DATAENTRY.ASP that has about 70 data fields that can be populated. I POST the form&#039;s data to DATACONFIRM.ASP, which does some data validation.<BR><BR>If invalid data has been entered, then I Redirect to DATAENTRY.ASP and pass a parameter to indicate which data field is invalid so that I can Write an error at the top of the form. Needless to say, all the previously entered data has been erased.<BR><BR>Based on your response, do I need to set up a loop in DATACONFIRM.ASP to set 70 fields as hidden fields so they can be passed back to DATAENTRY.ASP? Seems ugly to me - is there a better way? And should I actually Server.Transfer to a brand-new data entry screen, say DATA_REENTRY.ASP so that I don&#039;t have muck around in DATAENTRY.ASP deciding whether to show empty fields for a new record or previous fields for the invalid record?<BR><BR>Thanks in advance,<BR><BR>David<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