Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > control value must be case sensitive?

Reply
Thread Tools

control value must be case sensitive?

 
 
Matthew Louden
Guest
Posts: n/a
 
      01-12-2004
I am using VBScript for ASP. The control value must be case sensitive? The
following example should print the "fname" value, but if if I change
"submit" back to "SUBMIT". Then it works fine.

<%
If (Request.QueryString("submit") = "submit") Then
Response.Write(Request.QueryString("fname"))
End if
%>

<form action="formtest.asp" method="get">
<P><input type="text" name="fname">
<P><input type="submit" name="submit" value="SUBMIT">
</form>

Please advise! Thanks!


 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      01-12-2004
Yes, equality of strings is case sensitive. You can use lcase or ucase on
both sides of the equation to make sure it is not case sensitive...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




"Matthew Louden" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am using VBScript for ASP. The control value must be case sensitive? The
> following example should print the "fname" value, but if if I change
> "submit" back to "SUBMIT". Then it works fine.
>
> <%
> If (Request.QueryString("submit") = "submit") Then
> Response.Write(Request.QueryString("fname"))
> End if
> %>
>
> <form action="formtest.asp" method="get">
> <P><input type="text" name="fname">
> <P><input type="submit" name="submit" value="SUBMIT">
> </form>
>
> Please advise! Thanks!
>
>



 
Reply With Quote
 
 
 
 
John Beschler
Guest
Posts: n/a
 
      01-12-2004
IN VB Script control names are not case sensitive;
however, in string comparisons VB script IS case
sensitive. The problem is not with your control name. It
is with the fact that the string comparison is comparing
the contents of Request.QueryString("submit") which
is "SUBMIT" with a string which has a value of "submit".
They are not the same.

String comparisons in VB are always case sensitive.

HTH,
John



>-----Original Message-----
>I am using VBScript for ASP. The control value must be

case sensitive? The
>following example should print the "fname" value, but if

if I change
>"submit" back to "SUBMIT". Then it works fine.
>
> <%
> If (Request.QueryString("submit") = "submit") Then
> Response.Write(Request.QueryString("fname"))
> End if
> %>
>
> <form action="formtest.asp" method="get">
> <P><input type="text" name="fname">
> <P><input type="submit" name="submit" value="SUBMIT">
> </form>
>
>Please advise! Thanks!
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Case expression must be constant expression Philipp Java 26 11-25-2007 10:10 PM
Why must and must not be "final" ? NeoGeoSNK Java 25 11-24-2006 02:02 AM
Case choice must be a locally static expression. Kenneth Johansson VHDL 9 05-09-2005 06:02 PM
error "choice must be discrete range" with CASE Manfred Balik VHDL 3 04-30-2005 11:18 AM
Error:Case expression must be of a locally static subtype. Mohammed A khader VHDL 1 01-28-2005 11:02 AM



Advertisments