Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return the user to a part completed page

Status
Not open for further replies.

nk9100

Technical User
May 13, 2005
67
GB
Hi,

I am creating a survey site for a client, and I am wondering if you may have a clue about how to enable them to return to a page which the questions have not been completed?

I have a login etc, there are four pages, with data submitted after each page, any ideas?



Life is a journey that always ends up in the place
 
Could I use an if statement to display an image based on content in a database?

Life is a journey that always ends up in the place
 
My preference has always been to validate the data on the same page, preferably without resubmitting that page.
I use javascript and trap the submit button with an onsubmit event, test the fields as to whether they have been properly completed and then either submit the form or do something to alert the user that they have to make corrections. Generally I change the color of the text or input field that has the error and pop up a message.

Others submit the form to itself passing a value that tells the page how/what to display based on the value passed.

If you have to bounce from your ASP page back to your forms page though you can in your ASP page build a form with all hidden inputs and pass the form field info into those hidden fields so you can hand them back to the original form again. Your original form will have to distinguish between a newly submitted form and one that is re-loaded and will still need to determine where the errors occured.
 
Once you retrieve data from a database you can of course use it any way you like.

If rs(3) = "Hello" Then
response.write "<img src="myimage.jpg">
Else
response.write "<img srce="myotherimage.jpg">
End If

You just have to make sure your code is in the appropriate place in your script that the image displays where you wanted it.
 
i would suggest you to have a boolean session variable on each page which you toggle between true and false depending on whether user completed the questions on that page...if not redirect the user to that page by checking the boolean variable...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top