Re: What the H_ _ _ am I doing wrong????
case info is usually sent vit the url in a querystring or in a hidden form variable. I'll do the querystring example for you but the hidden form field is just as easy.
the Url you are passing http://www.somedomain.com?lan=English
select case request.queryst ring("lan")
case "English"
do something here
case "French"
do something here
case else
do something here
end select
thats pretty much it - the case else statement is a default if nothing else is chosen
Hope that helps
- Bastard
On Sat, 7 Aug 2004 17:21:54 -0400, "Brad" <info@webdevcre ations.com> wrote:
[color=blue]
>This entire thing is rather embarrassing as I cannto get it to work.
>
>I have 2 input strings that will contain URL's (the contents of the textbox
>strings is a non-issue.
>
>I have to allow the user to be able to enter into JUST the English OR Just
>the FRENCH or be able to Enter into BOTH ENGLISH and FRENCH
>
>I was using an IF ELSE statement but was having a hard time with it, as the
>scenerio's conflicted.
>
>Example:
>
>If strEnglish<>emp ty AND strFrench <>empty Then 'Both have something inside
>them
>'ENTER BOTH INTO DB
>End If
>
>If strEnglish<>emp ty Then 'Just English has something
>inside it
>'ENTER JUST THE ENGLISH
>End If
>
>If strFrench<>empt y Then 'Just French has something
>inside it
>'ENTER JUST THE FRENCH
>End If
>
>
>Now for BOTH of the string textbox inputs , it worked well, but if I just
>entered on either ENGLISH or FRENCH, well it would not acknowledge it......
>
>So I think that maybe I should be using a CASE SELECT..but now I have no
>idea how to make that work for my code, especially in ASP.
>
>SAD yet true...but willing to learn how to make it work..........b ut have
>yet to find an example that will make me understand..per haps I am making it
>harder than it is...a usual problem of mine.;))
>
>Can someone help me out here, as I am having a hard time to get this to
>work.
>
>Thanks in advance,
>
>~Brad (NEWBIE to ASP CASE Selects)
>
>"Newbie" <Newbie@helpme. com> wrote in message
>news:Y0bRc.504 93$Vm1.1312419@ news20.bellglob al.com...[color=green]
>> Dear friends,
>>
>> I am having a hard time understanding how to use a SELECT CASE in ASP. I
>> have used it in VB but never in ASP scripting.
>>
>> Scenerio:
>>
>> I have 2 textboxes on a form that I have to allow entry to one or the[/color]
>other[color=green]
>> or Both at the same time. Now I tried to use an If ElseIf but it got too
>> hard to track, so now I am using a SELECT CASE Statement.
>>
>> TEXBOX1 named strEnglish
>> TEXBOX2 named strFrench
>>
>> My code:
>> <%
>> strEnglish=Requ est.Form("strEn glish")
>> strFrench=Reque st.Form("strFre nch")
>>
>> Select Case
>>
>> Then I have no idea how to go from here, because I have 2 input textboxes[/color]
>to[color=green]
>> follow.
>>
>>
>> I found this example but I do not know how to apply it to my situation as[/color]
>I[color=green]
>> have to folow 2 textbox entries.
>>
>> <%
>> UserName=reques t.form("UserNam e")
>> Select Case UserName
>> Case "Kathi"
>> Msg = "You deserve a break. Take the day off!"
>> Case "JD","Anne"
>> Msg = "Don't forget to call Kathi today!"
>> Case Else
>> Msg = "Do I know you?"
>> End Select
>> response.write Msg
>> %>
>>
>> Can someone please help me out, a known tutorial, perhaps an example or[/color]
>just[color=green]
>> plain good ole help please??
>>
>> Thanks in advance,
>>
>> ~Newbie
>>
>>[/color]
>[/color]
case info is usually sent vit the url in a querystring or in a hidden form variable. I'll do the querystring example for you but the hidden form field is just as easy.
the Url you are passing http://www.somedomain.com?lan=English
select case request.queryst ring("lan")
case "English"
do something here
case "French"
do something here
case else
do something here
end select
thats pretty much it - the case else statement is a default if nothing else is chosen
Hope that helps
- Bastard
On Sat, 7 Aug 2004 17:21:54 -0400, "Brad" <info@webdevcre ations.com> wrote:
[color=blue]
>This entire thing is rather embarrassing as I cannto get it to work.
>
>I have 2 input strings that will contain URL's (the contents of the textbox
>strings is a non-issue.
>
>I have to allow the user to be able to enter into JUST the English OR Just
>the FRENCH or be able to Enter into BOTH ENGLISH and FRENCH
>
>I was using an IF ELSE statement but was having a hard time with it, as the
>scenerio's conflicted.
>
>Example:
>
>If strEnglish<>emp ty AND strFrench <>empty Then 'Both have something inside
>them
>'ENTER BOTH INTO DB
>End If
>
>If strEnglish<>emp ty Then 'Just English has something
>inside it
>'ENTER JUST THE ENGLISH
>End If
>
>If strFrench<>empt y Then 'Just French has something
>inside it
>'ENTER JUST THE FRENCH
>End If
>
>
>Now for BOTH of the string textbox inputs , it worked well, but if I just
>entered on either ENGLISH or FRENCH, well it would not acknowledge it......
>
>So I think that maybe I should be using a CASE SELECT..but now I have no
>idea how to make that work for my code, especially in ASP.
>
>SAD yet true...but willing to learn how to make it work..........b ut have
>yet to find an example that will make me understand..per haps I am making it
>harder than it is...a usual problem of mine.;))
>
>Can someone help me out here, as I am having a hard time to get this to
>work.
>
>Thanks in advance,
>
>~Brad (NEWBIE to ASP CASE Selects)
>
>"Newbie" <Newbie@helpme. com> wrote in message
>news:Y0bRc.504 93$Vm1.1312419@ news20.bellglob al.com...[color=green]
>> Dear friends,
>>
>> I am having a hard time understanding how to use a SELECT CASE in ASP. I
>> have used it in VB but never in ASP scripting.
>>
>> Scenerio:
>>
>> I have 2 textboxes on a form that I have to allow entry to one or the[/color]
>other[color=green]
>> or Both at the same time. Now I tried to use an If ElseIf but it got too
>> hard to track, so now I am using a SELECT CASE Statement.
>>
>> TEXBOX1 named strEnglish
>> TEXBOX2 named strFrench
>>
>> My code:
>> <%
>> strEnglish=Requ est.Form("strEn glish")
>> strFrench=Reque st.Form("strFre nch")
>>
>> Select Case
>>
>> Then I have no idea how to go from here, because I have 2 input textboxes[/color]
>to[color=green]
>> follow.
>>
>>
>> I found this example but I do not know how to apply it to my situation as[/color]
>I[color=green]
>> have to folow 2 textbox entries.
>>
>> <%
>> UserName=reques t.form("UserNam e")
>> Select Case UserName
>> Case "Kathi"
>> Msg = "You deserve a break. Take the day off!"
>> Case "JD","Anne"
>> Msg = "Don't forget to call Kathi today!"
>> Case Else
>> Msg = "Do I know you?"
>> End Select
>> response.write Msg
>> %>
>>
>> Can someone please help me out, a known tutorial, perhaps an example or[/color]
>just[color=green]
>> plain good ole help please??
>>
>> Thanks in advance,
>>
>> ~Newbie
>>
>>[/color]
>[/color]
Comment