[Javascript] Re: turning on checkboxes

Filipiak, Bob (Contractor) filipiab at atsc.army.mil
Tue Aug 14 08:31:11 CDT 2001


Sorry, use elements[] instead of element[]

Bob Filipiak (Contractor)
MCP 

-----Original Message-----
From: susan at plonka.com [mailto:susan at plonka.com]
Sent: Monday, August 13, 2001 4:32 PM
To: Javascript at LaTech.edu
Subject: [Javascript] Re: turning on checkboxes


I'm having trouble getting your solution working. It says 
document.memberForm.element is null or not an object. After printing 
alert 1, it fails before alert 2. Any suggestions on how I might test 
for nulls?

function selectAll(){
	for ( var i =0; i < document.memberForm.length; i++){
		alert("alert 1");
		if ( document.memberForm.element[i] != null){
			alert("alert 2");
			if ( document.memberForm.element[i].type 
== "checkbox"){
				alert("alert 3");
				document.memberForm.element
[i].checked = TRUE;
			}
		}
  	}
}

Thanks,
-Susan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010814/f1372144/attachment.htm>


More information about the Javascript mailing list