http://www.perlmonks.org?node_id=465126

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I am having a few probs with the below
print "Content-type: text/html\n\n"; print "<html><head><script="javascript" src="demo.js"</script><title>T +ESTING</title></head>"; .... <FORM ACTION="expandtree.cgi" METHOD="POST" ENCTYPE="multipart/form-data"> <div align="left"><br> <input type="checkbox" name="option1" value="N" checked> N-linked<br> <SELECT MULTIPLE NAME=demo SIZE=2> <OPTION VALUE="A1">A1 <OPTION VALUE="A2">A2 </SELECT> <INPUT TYPE=button VALUE="Select All" ONCLICK="selectAll(this.form.dem +o,true)"> <INPUT TYPE=button VALUE="Clear All" ONCLICK="selectAll(this.form.demo +,false)">
the demo.js is
function selectAll(cbList,bSelect) { for (var i=0; i<cbList.length; i++) cbList[i].selected = cbList[i].checked = bSelect }
the code worngs fine til i incorporate the javascript code Thanks