Drew
Thu Apr 07 09:37:05 CDT 2005
Fixed! Went around this problem and fixed it...
"Drew" <drew.laing@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:uxROsY3OFHA.164@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" <drew.laing@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
>>>news:e%23uozisOFHA.1176@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:OVJABHsOFHA.3940@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" <drew.laing@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
>>>>> news:%23g2ZXtrOFHA.3000@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:%23YLjrorOFHA.3716@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" <drew.laing@NOswvtc.dmhmrsas.virginia.SPMgov> wrote in
>>>>>>> message
>>>>>>> news:Ov8SOfrOFHA.3076@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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
>