[Javascript] Need Checkbox help.

Quale, Michael QualeM at americanimaging.net
Tue Aug 21 13:35:23 CDT 2001


I'm creating a dynamic list of check boxes based on the form selected.

I have parent checkboxes which can have multiple child checkboxes.

If a user selects a child I need to (onchange) check the parent checkbox.

I'm tried many combinations of the code below but keep getting
"document.precert_request_form5.pBox not an object" errors.

**********
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function selectParent(cBox,pBox)
{
	if(cBox.checked == true) {
		document.precert_request_form5.pBox.checked = true;
		}	
}

//-->
</SCRIPT>
*********

'Dynamically built parent checkbox
<input type=checkbox id="<%=rs("item_id")%>" name="<%=rs("item_id")%>"
value="<%=rs("item_id")%>">

'Dynamically built child checkbox
<input type=checkbox id="<%=rs("item_id")%>" name="<%=rs("item_id")%>"
value="<%=rs("item_id")%>" LANGUAGE=javascript
onclick="selectParent(this,<%=rsDisplayAll("parent_id")%>)">

Any help is good help!

Thanks,

Mike Q.          





More information about the Javascript mailing list