473,231 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Check Box Problem

On PageA I have:
<Input Type="CheckBox" Name="chkBox" Size="1" Value="True"
checked>

Which works fine!

On PageB I have;
<%If Request("chkBox")=True Then
Response.Write "True"
Else
Response.Write "False"
End If%>

This is where I am having trouble.

Can I see if the Check Box has been checked in VBScript or
do I have to use Java?, where I am very poor.

This is the fifth time I have submitted this. Either I am
having a difficult time understanding what I have been
instructed or it might be more difficult than people
think. I am not a very good programmer, I am a math
teacher and loved assembler. This object stuff confuses
me.

Thanx in Advance

Tony Zine
Jul 19 '05 #1
3 13679
Both of the following work:

1. In the following, you don't have to test against TRUE:

<%If Request("chkBox") Then
Response.Write "True"
Else
Response.Write "False"
End If%>
2. This is almost the same as what you had, but since the 'value' for
your checkbox (on your first form) is "True", you need to test against
'True' in quotes. And it is case-sensitive. If your 'value' for the
checkbox was 'itschecked', then 'If Request("chkBox")="itschecked"'
would also work.

<%If Request("chkBox")="True" Then
Response.Write "True"
Else
Response.Write "False"
End If%>
I don't have a good explanation at to why your version doesn't work
.... seems like the test should resolve to boolean TRUE, which should
work. Maybe someone else can respond to that.

Terry

On Mon, 15 Dec 2003 19:56:36 -0800, "Tony" <na*****@zianet.com> wrote:
On PageA I have:
<Input Type="CheckBox" Name="chkBox" Size="1" Value="True"
checked>

Which works fine!

On PageB I have;
<%If Request("chkBox")=True Then
Response.Write "True"
Else
Response.Write "False"
End If%>

This is where I am having trouble.

Can I see if the Check Box has been checked in VBScript or
do I have to use Java?, where I am very poor.

This is the fifth time I have submitted this. Either I am
having a difficult time understanding what I have been
instructed or it might be more difficult than people
think. I am not a very good programmer, I am a math
teacher and loved assembler. This object stuff confuses
me.

Thanx in Advance

Tony Zine


Jul 19 '05 #2
What part of the previous replies don't you understand? In what you have
below, you can know if the user checked the checkbox AFTER THE USER CLICKS
SUBMIT, by using:

<%
If Request.Form("chkBox") = "True" Then
Response.Write "True"
Else
Response.Write "False"
End If
%>

The value submitted in the form isn't an actual boolean value. It's merely
a string that says "true." You can give your checkbox a value "kajsdf" and
then do:

<% If request.form("chkBox") = "kajsdf" Then response.write "true" %>

Additionally, if you just want to know if the checkbox was checked, all you
really need to check for is if
Request.form("chkBox") <> ""

If the checkbox has a value, and the form is submitted with the checkbox
checked, the value of it will NOT be an empty string.
You may wonder what the point of having a checkbox value is then if it can
be anything arbitrary to find out if it was checked, but we can cover the
usefulness in a future post. :]

One last thing: As a math teacher, you should appreciate this, if you have
not yet heard about it.
http://www.foxnews.com/story/0,2933,105383,00.html

It's pretty amazing that a number that large...

Ray at home

"Tony" <na*****@zianet.com> wrote in message
news:14*****************************@phx.gbl...
On PageA I have:
<Input Type="CheckBox" Name="chkBox" Size="1" Value="True"
checked>

Which works fine!

On PageB I have;
<%If Request("chkBox")=True Then
Response.Write "True"
Else
Response.Write "False"
End If%>

This is where I am having trouble.

Can I see if the Check Box has been checked in VBScript or
do I have to use Java?, where I am very poor.

This is the fifth time I have submitted this. Either I am
having a difficult time understanding what I have been
instructed or it might be more difficult than people
think. I am not a very good programmer, I am a math
teacher and loved assembler. This object stuff confuses
me.

Thanx in Advance

Tony Zine

Jul 19 '05 #3
p.s. To further confuse you, you can do this. ;]

Response.Write CBool(Request.Form("chkBox"))

Ray home

"Ray at <%=sLocation%>" <myFirstNameATlane34dotKOMM> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl...
What part of the previous replies don't you understand? In what you have
below, you can know if the user checked the checkbox AFTER THE USER CLICKS
SUBMIT, by using:

<%
If Request.Form("chkBox") = "True" Then
Response.Write "True"
Else
Response.Write "False"
End If
%>

The value submitted in the form isn't an actual boolean value. It's merely a string that says "true." You can give your checkbox a value "kajsdf" and then do:

<% If request.form("chkBox") = "kajsdf" Then response.write "true" %>

Additionally, if you just want to know if the checkbox was checked, all you really need to check for is if
Request.form("chkBox") <> ""

If the checkbox has a value, and the form is submitted with the checkbox
checked, the value of it will NOT be an empty string.
You may wonder what the point of having a checkbox value is then if it can
be anything arbitrary to find out if it was checked, but we can cover the
usefulness in a future post. :]

One last thing: As a math teacher, you should appreciate this, if you have not yet heard about it.
http://www.foxnews.com/story/0,2933,105383,00.html

It's pretty amazing that a number that large...

Ray at home

"Tony" <na*****@zianet.com> wrote in message
news:14*****************************@phx.gbl...
On PageA I have:
<Input Type="CheckBox" Name="chkBox" Size="1" Value="True"
checked>

Which works fine!

On PageB I have;
<%If Request("chkBox")=True Then
Response.Write "True"
Else
Response.Write "False"
End If%>

This is where I am having trouble.

Can I see if the Check Box has been checked in VBScript or
do I have to use Java?, where I am very poor.

This is the fifth time I have submitted this. Either I am
having a difficult time understanding what I have been
instructed or it might be more difficult than people
think. I am not a very good programmer, I am a math
teacher and loved assembler. This object stuff confuses
me.

Thanx in Advance

Tony Zine


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Dave Smithz | last post by:
Hi there, A PHP application I built has a section which lists a number of members to a club whose names each appear with a check box beside them that can be ticked. These check boxes are part...
8
by: pw | last post by:
Hi, I need to create a function in javascript to check or uncheck all checkboxes in a form. From what I understand, I can do this either by specifying the name of the check box fields such as: ...
4
by: welie | last post by:
I have a problem canceling a check box update when placing a check in it. Checkbox is not bound. Here is what happens. User clicks a check box. In the BeforeUpdate method of the control, if...
6
by: Shannan Casteel via AccessMonster.com | last post by:
I'll explain as well as possible...not an experienced user...but learning. I am working on a database for different kinds of problems with machines. A user will be able to select a problem...
1
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will...
6
by: tommaso.gastaldi | last post by:
Hi, does anybody know a speedy analog of IsNumeric() to check for strings/chars. I would like to check if an Object can be treated as a string before using a Cstr(), clearly avoiding the time...
12
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
1
by: icetalks | last post by:
have a look at this code , its for logging the user in after checking his UserName and Password. dim check as boolean = false ... ... If txtUserName.Text.Length = 0 And txtPass.Text.Length =...
2
by: Ben | last post by:
Hi! All of a sudden on a newer version of our application a check box on the "Produce Invoice" form cannot be checked. I did not do any changes to this form at all. Below are the things that...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.