473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

If statement confusion

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

Jul 22 '05 #1
8 1221
Let me see if I have this right.. you want the page to post/save if they use
the back button? Aint gonna happen.
If they use the back button they lose the data on the page they are on. Now,
the OTHER data, from previous pages.. Well that's another story. I suggest
storing it in either Session() data or, preferably, a database, as they move
along. Then its much easier to check for when each page loads.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
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

Jul 22 '05 #2
Let me rephrase... Not the back button of the browser, but a submit button
named submit1 that has a caption of Back.

Sorry
Drew

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Let me see if I have this right.. you want the page to post/save if they
use the back button? Aint gonna happen.
If they use the back button they lose the data on the page they are on.
Now, the OTHER data, from previous pages.. Well that's another story. I
suggest storing it in either Session() data or, preferably, a database, as
they move along. Then its much easier to check for when each page loads.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
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


Jul 22 '05 #3
Ahhh...
And since Page1.asp and Page3.asp could BOTH go to Page2.asp you aren't sure
how to handle this, is that what you are saying?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Let me rephrase... Not the back button of the browser, but a submit button
named submit1 that has a caption of Back.

Sorry
Drew

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Let me see if I have this right.. you want the page to post/save if they
use the back button? Aint gonna happen.
If they use the back button they lose the data on the page they are on.
Now, the OTHER data, from previous pages.. Well that's another story. I
suggest storing it in either Session() data or, preferably, a database,
as they move along. Then its much easier to check for when each page
loads.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
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



Jul 22 '05 #4
Pretty much. My conditional isn't working correctly and that is the
problem. Sorry that you are having to dredge this info out of me, I just
failed to mention it.

I am working on doing some testing on the conditional, I will reply when I
figure out what it is doing wrong (besides not working).

Drew
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
Ahhh...
And since Page1.asp and Page3.asp could BOTH go to Page2.asp you aren't
sure how to handle this, is that what you are saying?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Let me rephrase... Not the back button of the browser, but a submit
button named submit1 that has a caption of Back.

Sorry
Drew

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Let me see if I have this right.. you want the page to post/save if they
use the back button? Aint gonna happen.
If they use the back button they lose the data on the page they are on.
Now, the OTHER data, from previous pages.. Well that's another story. I
suggest storing it in either Session() data or, preferably, a database,
as they move along. Then its much easier to check for when each page
loads.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
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




Jul 22 '05 #5
The conditionals are setup like this,

After page2.asp is submitted it goes to page3.asp

recordset code for checking to see if the record is available

If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
Insert Code
Else
Update Code
End If

But then I added another button to page2.asp which is named submit1 and
captioned "Back", so if it is clicked, I want the data to be
inserted/updated (determined by the above conditional) and then redirect to
page1.asp

If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect

How can I combine these 2 conditionals in one?

This doesn't seem to work,

If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect
Else
Insert Code
End If
Else
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Update Code
Response.Redirect
Else
Update Code
End If
End If

Thanks,
Drew

"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:e%****************@TK2MSFTNGP12.phx.gbl...
Pretty much. My conditional isn't working correctly and that is the
problem. Sorry that you are having to dredge this info out of me, I just
failed to mention it.

I am working on doing some testing on the conditional, I will reply when I
figure out what it is doing wrong (besides not working).

Drew
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
Ahhh...
And since Page1.asp and Page3.asp could BOTH go to Page2.asp you aren't
sure how to handle this, is that what you are saying?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Let me rephrase... Not the back button of the browser, but a submit
button named submit1 that has a caption of Back.

Sorry
Drew

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Let me see if I have this right.. you want the page to post/save if
they use the back button? Aint gonna happen.
If they use the back button they lose the data on the page they are on.
Now, the OTHER data, from previous pages.. Well that's another story. I
suggest storing it in either Session() data or, preferably, a database,
as they move along. Then its much easier to check for when each page
loads.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
>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
>
>
>



Jul 22 '05 #6
On Wed, 6 Apr 2005 13:09:24 -0400, "Drew"
<dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote:
The conditionals are setup like this,

After page2.asp is submitted it goes to page3.asp

recordset code for checking to see if the record is available

If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
Insert Code
Else
Update Code
End If

But then I added another button to page2.asp which is named submit1 and
captioned "Back", so if it is clicked, I want the data to be
inserted/updated (determined by the above conditional) and then redirect to
page1.asp

If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect

How can I combine these 2 conditionals in one?
Which two conditionals? You have a single one here, if the submit to
the form came from page 2.
This doesn't seem to work,
"Doesn't seem to work" how? Does it cause the workstation to burst
into flames? Or does it simply not behave as you expect? And what
would that behavior be? Versus what did you expect?

Jeff

If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect
Else
Insert Code
End If
Else
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Update Code
Response.Redirect
Else
Update Code
End If
End If

Thanks,
Drew

"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:e%****************@TK2MSFTNGP12.phx.gbl...
Pretty much. My conditional isn't working correctly and that is the
problem. Sorry that you are having to dredge this info out of me, I just
failed to mention it.

I am working on doing some testing on the conditional, I will reply when I
figure out what it is doing wrong (besides not working).

Drew
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
Ahhh...
And since Page1.asp and Page3.asp could BOTH go to Page2.asp you aren't
sure how to handle this, is that what you are saying?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Let me rephrase... Not the back button of the browser, but a submit
button named submit1 that has a caption of Back.

Sorry
Drew

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
> Let me see if I have this right.. you want the page to post/save if
> they use the back button? Aint gonna happen.
> If they use the back button they lose the data on the page they are on.
> Now, the OTHER data, from previous pages.. Well that's another story. I
> suggest storing it in either Session() data or, preferably, a database,
> as they move along. Then its much easier to check for when each page
> loads.
>
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
> news:Ov**************@TK2MSFTNGP12.phx.gbl...
>>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
>>
>>
>>
>
>



Jul 22 '05 #7
>>The conditionals are setup like this,

After page2.asp is submitted it goes to page3.asp

recordset code for checking to see if the record is available

If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
Insert Code
Else
Update Code
End If
Above is the first conditional

But then I added another button to page2.asp which is named submit1 and
captioned "Back", so if it is clicked, I want the data to be
inserted/updated (determined by the above conditional) and then redirect
to
page1.asp

If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect
Above is the second conditional

How can I combine these 2 conditionals in one?
Which two conditionals? You have a single one here, if the submit to
the form came from page 2.


I have commented above so that you can see that there are 2 conditionals...
must have overlooked them, huh? Before we go on, 1 + 1 = 2, right?
This doesn't seem to work,


"Doesn't seem to work" how? Does it cause the workstation to burst
into flames? Or does it simply not behave as you expect? And what
would that behavior be? Versus what did you expect?


If I click the back button (submit1, not the actual back button), the page
doesn't redirect like it should.

Below is the 2 conditionals from above (1+1 is still 2, right?) combined
together, and this is how I have them in the page.

Thanks,
Drew
If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect
Else
Insert Code
End If
Else
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Update Code
Response.Redirect
Else
Update Code
End If
End If



Thanks,
Drew

"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:e%****************@TK2MSFTNGP12.phx.gbl.. .
Pretty much. My conditional isn't working correctly and that is the
problem. Sorry that you are having to dredge this info out of me, I
just
failed to mention it.

I am working on doing some testing on the conditional, I will reply when
I
figure out what it is doing wrong (besides not working).

Drew
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
Ahhh...
And since Page1.asp and Page3.asp could BOTH go to Page2.asp you aren't
sure how to handle this, is that what you are saying?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
> Let me rephrase... Not the back button of the browser, but a submit
> button named submit1 that has a caption of Back.
>
> Sorry
> Drew
>
> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
> news:%2****************@TK2MSFTNGP14.phx.gbl...
>> Let me see if I have this right.. you want the page to post/save if
>> they use the back button? Aint gonna happen.
>> If they use the back button they lose the data on the page they are
>> on.
>> Now, the OTHER data, from previous pages.. Well that's another story.
>> I
>> suggest storing it in either Session() data or, preferably, a
>> database,
>> as they move along. Then its much easier to check for when each page
>> loads.
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
>> "Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
>> news:Ov**************@TK2MSFTNGP12.phx.gbl...
>>>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
>>>
>>>
>>>
>>
>>
>
>

Jul 22 '05 #8
Fixed! Went around this problem and fixed it...
"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:ux*************@TK2MSFTNGP12.phx.gbl...
The conditionals are setup like this,

After page2.asp is submitted it goes to page3.asp

recordset code for checking to see if the record is available

If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
Insert Code
Else
Update Code
End If
Above is the first conditional

But then I added another button to page2.asp which is named submit1 and
captioned "Back", so if it is clicked, I want the data to be
inserted/updated (determined by the above conditional) and then redirect
to
page1.asp

If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect
Above is the second conditional

How can I combine these 2 conditionals in one?


Which two conditionals? You have a single one here, if the submit to
the form came from page 2.


I have commented above so that you can see that there are 2
conditionals... must have overlooked them, huh? Before we go on, 1 + 1 =
2, right?
This doesn't seem to work,


"Doesn't seem to work" how? Does it cause the workstation to burst
into flames? Or does it simply not behave as you expect? And what
would that behavior be? Versus what did you expect?


If I click the back button (submit1, not the actual back button), the page
doesn't redirect like it should.

Below is the 2 conditionals from above (1+1 is still 2, right?) combined
together, and this is how I have them in the page.

Thanks,
Drew
If rs.EOF AND rs.BOF Then (If the rs is empty, then that means that the
record needs to be inserted)
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Insert Code
Response.Redirect
Else
Insert Code
End If
Else
If Request.Form("submit1") <> "" Then (If submit1 was clicked)
Update Code
Response.Redirect
Else
Update Code
End If
End If



Thanks,
Drew

"Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:e%****************@TK2MSFTNGP12.phx.gbl. ..
Pretty much. My conditional isn't working correctly and that is the
problem. Sorry that you are having to dredge this info out of me, I
just
failed to mention it.

I am working on doing some testing on the conditional, I will reply
when I
figure out what it is doing wrong (besides not working).

Drew
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
> Ahhh...
> And since Page1.asp and Page3.asp could BOTH go to Page2.asp you
> aren't
> sure how to handle this, is that what you are saying?
>
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
> news:%2****************@TK2MSFTNGP10.phx.gbl...
>> Let me rephrase... Not the back button of the browser, but a submit
>> button named submit1 that has a caption of Back.
>>
>> Sorry
>> Drew
>>
>> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
>> news:%2****************@TK2MSFTNGP14.phx.gbl...
>>> Let me see if I have this right.. you want the page to post/save if
>>> they use the back button? Aint gonna happen.
>>> If they use the back button they lose the data on the page they are
>>> on.
>>> Now, the OTHER data, from previous pages.. Well that's another
>>> story. I
>>> suggest storing it in either Session() data or, preferably, a
>>> database,
>>> as they move along. Then its much easier to check for when each page
>>> loads.
>>>
>>> --
>>> Curt Christianson
>>> Site & Scripts: http://www.Darkfalz.com
>>> Blog: http://blog.Darkfalz.com
>>>
>>>
>>> "Drew" <dr********@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in
>>> message
>>> news:Ov**************@TK2MSFTNGP12.phx.gbl...
>>>>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
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Jul 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
4
by: Michael Haas | last post by:
I'm trying to use a variable of retrieved via request from a form to select records.I'm pretty sure I am having a basic syntax error or something else basic. I retrieve the variable from a ...
1
by: avinash | last post by:
hi my self avi i want to copy data from one table to other table,by giving certain condition and i want o use insert statement .in this i want to pass some value directly and some value from...
1
by: brett | last post by:
Here is my SQL string: "SELECT to_ordnum, to_orddate," _ & "(SELECT SUM((DDPROD.pr_stanmat * DDPROD.pr_prfact) * (DOBOM2.b2_quant * DDORD.or_quant)) FROM DDPROD INNER JOIN DOBOM2 ON...
8
by: Perre Van Wilrijk | last post by:
Hello, I have 2 ways of updating data I'm using often 1) via a cursor on TABLE1 update fields in TABLE2 2) via an some of variables ... SELECT @var1=FLD1, @var2=FLD2 FROM TABLE1 WHERE...
15
by: grunar | last post by:
After some thought on what I need in a Python ORM (multiple primary keys, complex joins, case statements etc.), and after having built these libraries for other un-named languages, I decided to...
2
by: Edward S | last post by:
I would appreciate if someone could correct my SQL statement which is displaying a message Expected : End of Statement this statment is attached to a button on the form StrSQL = "PARAMETERS !!...
15
by: Nerox | last post by:
Hi, If i write: #include <stdio.h> int foo(int); int main(void){ int a = 3; foo(a); }
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.