Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: creating forms over several web pages


Message #1 by "Alan Shiers" <ashiers@h...> on Sun, 9 Sep 2001 22:47:02
Hi there,

   I've been going through a book titled:

Beginning ASP Databases.  The book has been great and has covered every 

possible scenario up til now.  I have a client who wants me to create a web 

site that will incorporate an online survey.  The questions on the survey 

are many and will need to be spread out over several web pages.  The data 

is to be automatically stored into an Access database.



The book covers how to create an HTML file with the usual <FORM></FORM> 

form on it and shows how to process the data from the form.  However, what 

the book doesn't explain is how to maintain data from one web page to the 

next, collecting the data as you go, moving from one page to the next using 

a NEXT button, and in the end committing all that data to the database.  



If anyone has done this sort of thing before, would you be kind enough to 

explain to me how the data from each page is maintained and collected 

before the final submition on the last page?



Thanks,



Alan
Message #2 by "Paul Bruce" <pbruce@c...> on Mon, 24 Sep 2001 02:34:31
As I see it, you have 4 alternatives.



1. Store all your data in Cookies as you go through each of the pages. 



2. Store all your data in Sessions variables as you go through each of the 

pages.



3. Store data from the last page in hidden form data on the new page

(I would seriously consider this method) 



or 



4. (and this is the method I would use, if method 3 doesn't work out) 

Send each page to the database when going to the next page, and include an 

index to the database record in hidden form data. 

By including the index of the record in hidden form data, you know what 

record to update as the user goes through pages. 

Also you would have to reload data from the database in the form just in 

case the user went back a page (eg, include your own forward and backward 

buttons on the web page itself). 

On the final page, when it is entered into the database include a seperate 

field to indentify the submission as complete (this address users who only 

get half way through, get bored and don't complete the survey, your 

database would include an easily searchable field of users that acutually 

completed it wholly) 

A some error and process checking code would be required. 



Hope this helps



Paul












  Return to Index