[Javascript] Dynamic Checkbox onClick

Mike Ledig tracerbullet at gmx.net
Mon Jan 27 06:53:54 CST 2003


Hi Andrew,


Andrew McCombe schrieb:
> Hi
> 
> I'm creating a form with a variable amount of checkboxes.  I've got the
> following that is working fine:
> 
> 	var check = document.createElement("input");
> 
> 	check.setAttribute("type","checkbox");
> 	check.setAttribute("name","fault[]");
> 	check.setAttribute("value",handset[myHandset][i]);
> 	check.setAttribute("onClick","faultChecked(this);");

Just a guess:
check.onclick=faultChecked(check);
or
check.onClick=faultChecked(check); (but I think the event handler is 
smallcaps)

Another try:
check.setAttribute("onclick","faultChecked("+check+");");

HTH and greetings
Mike.

-- 
Training und Projekte
http://www.gidel.de




More information about the Javascript mailing list