CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Checking to see if a Checkbox is Checked

Print topic Send  topic

Author Message
kartracer

Posts: 21
Posted: 07/21/2006, 2:37 PM

I know for you experts this should be very straight forward but for a novice like me .. :-< I'm trying to determine if a checkbox is checked using Jabascript. The statement I have is:

HTML:
<input type="checkbox" value="1" name="{CheckBox1_Name}" {CheckBox1}>

if (document.form1.CheckBox1.Checked)
{
do a bunch of stuff
}

The "document.form1.CheckBox1.Checked" is always false or undefine. The Name is CheckBox1 and my data type is boolean. I there something I'm missing here? I'm using CCS3. Hopefully some one can help me out.

Thank you in advance.
View profile  Send private message
guest
Posted: 07/24/2006, 6:29 PM

yea having the same problem here - be interested in any solutions
kartracer

Posts: 21
Posted: 07/25/2006, 3:49 AM

Sorry, should have posted this earlier. As it turns out, you need to implicitly test for the value 'true'. This is the only way I could get it to work. Here's the code.

if (document.form1.CheckBox1.Checked==true)
{
do a bunch of stuff
}
else
{
do some other stuff
}

See if it works for you.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.