mat41
12-08-2004, 02:30 AM
I am trying to determine if the user has checked or unchecked a checkbox, the following code always seems to be running the if condition:
------------------------------------------
var mssge
var checked = false;
function testing(catId)
{
for (var i=0; i < editEvent.eventCategories.length; i++)
{
if(editEvent.eventCategories[i].checked == true)
{
checked = true;
mssge = ("you have checked : " + catId);
break;
}
else if(!checked)
{
mssge = ("you have unChecked : " + catId);
}
}
alert (mssge);
}
<input type="checkbox" name="eventCategories" onClick="testing(<%= intVal %>);">
-------------------------------------------
Please note : There are multiple checkboxes with the same name. The way the page is set up I would like to post a commer delimited string to the destination page (All the checkboxes have dynamic values)
I have been at this all morning. I am starting to believe my objective isnt all that strait forward, of course of they had unique names it would be.
I am looing forward to finding out if this is possible
TYIA your help is appreciated
------------------------------------------
var mssge
var checked = false;
function testing(catId)
{
for (var i=0; i < editEvent.eventCategories.length; i++)
{
if(editEvent.eventCategories[i].checked == true)
{
checked = true;
mssge = ("you have checked : " + catId);
break;
}
else if(!checked)
{
mssge = ("you have unChecked : " + catId);
}
}
alert (mssge);
}
<input type="checkbox" name="eventCategories" onClick="testing(<%= intVal %>);">
-------------------------------------------
Please note : There are multiple checkboxes with the same name. The way the page is set up I would like to post a commer delimited string to the destination page (All the checkboxes have dynamic values)
I have been at this all morning. I am starting to believe my objective isnt all that strait forward, of course of they had unique names it would be.
I am looing forward to finding out if this is possible
TYIA your help is appreciated