[Javascript] A better way to do this

tedd tedd at sperling.com
Tue Apr 29 13:23:44 CDT 2008


Hi gang:

There has to be a better way to do this:

function checkAll( form )
	{
	if(form.checkall.checked)
		{
		form.a1.checked = true;
		form.a2.checked = true;
		form.a3.checked = true;
		form.a4.checked = true;
		form.a5.checked = true;
		}
	else
		{
		form.a1.checked = false;
		form.a2.checked = false;
		form.a3.checked = false;
		form.a4.checked = false;
		form.a5.checked = false;
		}
	}

What say you?

Cheers,

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list