control value must be case sensitive?

Discussion in 'ASP General' started by Matthew Louden, Jan 12, 2004.

  1. 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!
     
    Matthew Louden, Jan 12, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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!
    >
    >
     
    Aaron Bertrand - MVP, Jan 12, 2004
    #2
    1. Advertising

  3. 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!
    >
    >
    >.
    >
     
    John Beschler, Jan 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boban Dragojlovic

    DropDownList values are case sensitive?

    Boban Dragojlovic, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,259
    Boban Dragojlovic
    Nov 6, 2003
  2. Martin Dechev
    Replies:
    0
    Views:
    567
    Martin Dechev
    Apr 2, 2004
  3. Replies:
    0
    Views:
    518
  4. Replies:
    1
    Views:
    2,505
    Mark P
    Apr 6, 2007
  5. Xah Lee
    Replies:
    4
    Views:
    1,004
Loading...

Share This Page