Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Dynamic Checkbox onClick


  • From: javascript@xxxxxxxxxx (Mike Ledig)
  • Subject: [Javascript] Dynamic Checkbox onClick
  • Date: Mon, 27 Jan 2003 13:53:54 +0100

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