Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Requested Variable is Empty

Reply
Thread Tools

Requested Variable is Empty

 
 
Erica
Guest
Posts: n/a
 
      02-28-2005
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>

 
Reply With Quote
 
 
 
 
Erica
Guest
Posts: n/a
 
      02-28-2005
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>
>

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-28-2005
=?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)

 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      02-28-2005
Try doing a "view source" on the html that the page generates.

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


"Erica" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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>
>



 
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
DetailsView ASP Control and an empty field not an empty record. ButlerDJIAM ASP .Net 0 11-09-2006 06:40 PM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
empty lists vs empty generators Brian Roberts Python 12 05-04-2005 08:59 PM
Check if a directory is empty and empty it Marcia Hon C Programming 8 02-14-2004 03:53 AM
empty/non-empty element John XML 1 07-16-2003 10:23 AM



Advertisments