Need Help Sequencing IF/ELSEIF statements to displ

Results 1 to 2 of 2

Thread: Need Help Sequencing IF/ELSEIF statements to displ

  1. #1
    Join Date
    Dec 1969

    Default Need Help Sequencing IF/ELSEIF statements to displ

    hi, and thx in advance for anyone who can help me out.<BR><BR>i am just learning to develop with ASP and am having some trouble.<BR>i&#039;ve got a sequence of forms as such:<BR>form 1 - search for a person<BR>form 2- select from the list of matching search results<BR>form 3 - record some info about that person into a database (Dr&#039;s appts for ex.)<BR><BR>i have currently got it working properly when it is split into four separate .ASP files i.e.<BR>form 1 submit leads to page with form 2<BR>form 2 submit leads to page with form 3<BR>etc etc<BR><BR>but i would like to get all four scripts into one page for ease of maintenance etc.<BR><BR>i have tried giving each form a submit button with the same name (cmdSubmit) and a different value for each form; so that when they click on the "find person" button then the .ASP will know to only include the "find a person" script<BR>and after they have searched for and selected a person, a different form will appear<BR>(i.e. to record a Dr. appt for that person)<BR>and this time the "find a person" script will not appear but the "record an appt" script will.<BR><BR>right now i basically have:<BR>(condensed for clarity heheh)<BR>IF request.form(cmdSubmit) = FindPerson THEN<BR>&#039; include FindPerson form & script here<BR>ELSEIF request.form(cmdSubmit) = SelectPerson THEN<BR>&#039; include SelectPerson form & script here<BR>ELSEIF request.form(cmdSubmit) = RecordAppt THEN<BR>&#039; include RecordAppt form & script here<BR>END IF<BR><BR>and that does not work; when the page first loads it is supposed to default to the Search form with no scripts until you press Submit, but right now when i try to load it i get<BR>ERROR - Name Redefined<BR>(that is because in the three above scripts i use some of the same variables in more than one)<BR>and apparently the ASP processing is trying to load all three of the above includes when i only want it to load the appropriate one depending on the value of the Submit button.<BR><BR>(whew, did that actually make any sense ;)<BR><BR>to anyone who is listening, or has any advice on what else i could try, I am much obliged.<BR><BR>if you want a better view of what i am doing, here is the first of the four separate pages up and running:<BR><BR>you can enter a last name and search and see what i mean. i know my search/record/update DB code all works, i am just having trouble creating a master page from the four separate ones.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Need Help Sequencing IF/ELSEIF statements to d

    I don&#039;t really see the need of putting this in one file, but anyway:<BR><BR><BR>IF request.form("mdSubmit") = "FindPerson" THEN<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts