By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,378 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

control value must be case sensitive?

P: n/a
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!
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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? Thefollowing 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!
.

Jul 19 '05 #2

P: n/a
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" <ma*******@hotmail.com> wrote in message
news:ev**************@tk2msftngp13.phx.gbl...
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!

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.