D
Drew
I have an app that I am building that takes user input on 1 page then
inserts/updates it on the next page. There are a total of 20 pages, with
data from page1 being modified by page2 and so on. I am trying to figure
out how to incorporate back buttons into this app, so the user can go back.
Currently I have tried many different ways to do this (short of re-writing
the pages to submit to themselves and then redirecting). The current train
of thought I am working off of is below,
Page2.asp
Input boxes and 2 buttons, Submit for going to the next page and submit1 for
going back
Page3.asp
'Check to see if the record needs to be inserted or updated
If rsWhatPeopleLike.EOF AND rsWhatPeopleLike.BOF Then
'Check to see if the Back button was clicked
'If so, redirect after modification
If Request.Form("submit1") <> "" Then
'Must have clicked Back, so insert and redirect
'insert code
Response.Redirect("Page1.asp")
Else
'Must have clicked Forward, so insert and go on
'insert code
End If
Else
'Check to see if the Back button was clicked
'If so, redirect after modification
If Request.Form("submit1") <> "" Then
'Check to see if the form fields were edited, if so Update the db
If Request.Form("PeopleLikeAndAdmire") <>
rsWhatPeopleLike("WhatPeopleLikeAndAdmire") Then
'Must have clicked Back, so update and redirect
'update code
Response.Redirect("Page1.asp")
Else
'Must have clicked Forward, so update and go on
'update code
End If
End If
End If
So the user clicks Forward on Page2.asp, then the code should just update or
insert (depending on whether there is a record in the db and if the record
is different than the data entered on page1.asp)
If the user clicks Back, it should alost update or insert and then redirect
back to page1.asp
Can anyone help me out with this? Or if you have a better idea on how to
accomplish this, I am open to suggestions!
Thanks,
Drew
inserts/updates it on the next page. There are a total of 20 pages, with
data from page1 being modified by page2 and so on. I am trying to figure
out how to incorporate back buttons into this app, so the user can go back.
Currently I have tried many different ways to do this (short of re-writing
the pages to submit to themselves and then redirecting). The current train
of thought I am working off of is below,
Page2.asp
Input boxes and 2 buttons, Submit for going to the next page and submit1 for
going back
Page3.asp
'Check to see if the record needs to be inserted or updated
If rsWhatPeopleLike.EOF AND rsWhatPeopleLike.BOF Then
'Check to see if the Back button was clicked
'If so, redirect after modification
If Request.Form("submit1") <> "" Then
'Must have clicked Back, so insert and redirect
'insert code
Response.Redirect("Page1.asp")
Else
'Must have clicked Forward, so insert and go on
'insert code
End If
Else
'Check to see if the Back button was clicked
'If so, redirect after modification
If Request.Form("submit1") <> "" Then
'Check to see if the form fields were edited, if so Update the db
If Request.Form("PeopleLikeAndAdmire") <>
rsWhatPeopleLike("WhatPeopleLikeAndAdmire") Then
'Must have clicked Back, so update and redirect
'update code
Response.Redirect("Page1.asp")
Else
'Must have clicked Forward, so update and go on
'update code
End If
End If
End If
So the user clicks Forward on Page2.asp, then the code should just update or
insert (depending on whether there is a record in the db and if the record
is different than the data entered on page1.asp)
If the user clicks Back, it should alost update or insert and then redirect
back to page1.asp
Can anyone help me out with this? Or if you have a better idea on how to
accomplish this, I am open to suggestions!
Thanks,
Drew