...

View Full Version : checking checkbox



eranwein
01-28-2006, 12:42 AM
view this code:

frm=document.forms['form1'];

if(frm[checkBoxName].checked == "checked")
{
alert(frm[checkBoxName].value);
}
else
{
frm[checkBoxName].checked == ""
}

i'm trying to get information about a checkbox and i'm checking to see if it's checked.

the problem is that the condition is never true (even if it's marked as "checked".

i've added the "else" just to see if it recognize it, and it does uncheck it.

where is the problam then?

Basscyst
01-28-2006, 01:12 AM
if(frm[checkBoxName].checked )
{
it is checked
}


or


if(frm[checkBoxName].checked == true)
{
it is checked
}


Basscyst

eranwein
01-28-2006, 01:18 AM
thanks man :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum