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.
|
|
|
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.
|
|
|
|