I am new to this forum and hope someone can direct me a little..
I have a checkbox that needs to be checked/unchecked under the following rules..
if any checkboxes with id like "REQ_ACCT_LAB_" are checked, then check it
if all of the checkboxes with id like "REQ_ACCT_LAB_" are unchecked, then uncheck it.
Is there a better way of doing this?
heres my code:
if ($("input[name^=REQ_ACCT_LAB_]").is(":checked"))
{
$("input[name=MY_CHK]").attr("checked","checked");
}
else
{
$("input[name=MY_CHK]").attr("checked","");
}
Thanks!

New Topic/Question
Reply



MultiQuote



|