Requested Variable is Empty

Discussion in 'ASP General' started by Erica, Feb 28, 2005.

  1. Erica

    Erica Guest

    I am trying to display an error if the txtmsg variable is true and the
    cellnumber and cellprovider variables are empty. Here is the code that
    generates my error:

    If request("txtmsg") = "true" then
    If request("cellprovider") = "0" or trim(request("cellnumber")) = "" then
    response.write("If user wants to be text messaged you must enter a cell
    provider and cell number for the user. Click the back button to re-enter.")
    end if
    end if

    --The problem is that the txtmsg variable has no value when I do a
    response.write for debugging. Here is the code from the form that passes the
    variable:


    <input name="txtmsg" type="checkbox" id="txtmsg" value="<%if
    request("txtmsg") = "true" then response.write("true") else
    response.write("false")%>" <%if Lcase(request.querystring("txtmsg")) = "true"
    then response.write("checked")%>>
    Yes, I want to recieve a text message on my cell phone when I
    recieve a fax.<br>
    Erica, Feb 28, 2005
    #1
    1. Advertising

  2. Erica

    Erica Guest

    I'm sorry, here is the code from that form that posts the txtmsg variable
    (see below):

    <input name="txtmsg" type="checkbox" id="txtmsg" value="true" <%if
    Lcase(request.querystring("txtmsg")) = "true" then
    response.write("checked")%>>

    "Erica" wrote:

    > I am trying to display an error if the txtmsg variable is true and the
    > cellnumber and cellprovider variables are empty. Here is the code that
    > generates my error:
    >
    > If request("txtmsg") = "true" then
    > If request("cellprovider") = "0" or trim(request("cellnumber")) = "" then
    > response.write("If user wants to be text messaged you must enter a cell
    > provider and cell number for the user. Click the back button to re-enter.")
    > end if
    > end if
    >
    > --The problem is that the txtmsg variable has no value when I do a
    > response.write for debugging. Here is the code from the form that passes the
    > variable:
    >
    >
    > <input name="txtmsg" type="checkbox" id="txtmsg" value="<%if
    > request("txtmsg") = "true" then response.write("true") else
    > response.write("false")%>" <%if Lcase(request.querystring("txtmsg")) = "true"
    > then response.write("checked")%>>
    > Yes, I want to recieve a text message on my cell phone when I
    > recieve a fax.<br>
    >
    Erica, Feb 28, 2005
    #2
    1. Advertising

  3. Erica

    Evertjan. Guest

    =?Utf-8?B?RXJpY2E=?= wrote on 28 feb 2005 in
    microsoft.public.inetserver.asp.general:

    > I'm sorry, here is the code from that form that posts the txtmsg
    > variable (see below):
    >
    > <input name="txtmsg" type="checkbox" id="txtmsg" value="true" <%if
    > Lcase(request.querystring("txtmsg")) = "true" then
    > response.write("checked")%>>
    >


    [please do not toppost on usenet]

    The lcase is not necessary, since it is lowercase anyway.

    try this, works fine overhere:

    <%
    if request.querystring("txtmsg") = "on" then
    ch = "checked"
    else
    ch = ""
    end if
    %>

    <form method="get">
    <input name="txtmsg"
    type="checkbox"
    <%=ch%> >
    <input type=submit>
    </form>


    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Feb 28, 2005
    #3
  4. Erica

    Mark Schupp Guest

    Try doing a "view source" on the html that the page generates.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Erica" <> wrote in message
    news:D...
    > I am trying to display an error if the txtmsg variable is true and the
    > cellnumber and cellprovider variables are empty. Here is the code that
    > generates my error:
    >
    > If request("txtmsg") = "true" then
    > If request("cellprovider") = "0" or trim(request("cellnumber")) = "" then
    > response.write("If user wants to be text messaged you must enter a cell
    > provider and cell number for the user. Click the back button to

    re-enter.")
    > end if
    > end if
    >
    > --The problem is that the txtmsg variable has no value when I do a
    > response.write for debugging. Here is the code from the form that passes

    the
    > variable:
    >
    >
    > <input name="txtmsg" type="checkbox" id="txtmsg" value="<%if
    > request("txtmsg") = "true" then response.write("true") else
    > response.write("false")%>" <%if Lcase(request.querystring("txtmsg")) =

    "true"
    > then response.write("checked")%>>
    > Yes, I want to recieve a text message on my cell phone

    when I
    > recieve a fax.<br>
    >
    Mark Schupp, Feb 28, 2005
    #4
    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. John

    empty/non-empty element

    John, Jul 15, 2003, in forum: XML
    Replies:
    1
    Views:
    1,014
    Klaus Johannes Rusch
    Jul 16, 2003
  2. Lukas
    Replies:
    3
    Views:
    789
    spiff
    Nov 10, 2005
  3. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    566
    Dave Thompson
    Feb 14, 2004
  4. Brian Roberts

    empty lists vs empty generators

    Brian Roberts, May 3, 2005, in forum: Python
    Replies:
    12
    Views:
    647
    Jeremy Bowers
    May 4, 2005
  5. ButlerDJIAM
    Replies:
    0
    Views:
    546
    ButlerDJIAM
    Nov 9, 2006
Loading...

Share This Page