<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Ok, we're getting somewhere. Now if you can tell us
what's supposed to happen and what event triggers the ".length is not" error
message, then we'll make it somewhere. I imagine it's when you click
this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><input type=checkbox name="driver_all" value="Check All"
onClick="check(this.form.list)"></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In the future, I suggest you put all of this
information in one e-mail for a speedy response. Otherwise, we spend our time
just trying to determine what it's supposed to do and not why it's not doing
it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Chris Tifer</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>P.S. Looked at it a little closer and it seems that
you only have one "list" elements (that's a bad name that I would avoid) and
1-item elements are not a collection, hence, there is no .length on them.
I'm guessing that's your problem. To test, add a second list item (and then
change that name to something that might not one day become a reserved
keyword.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=samyuktaakunuru@yahoo.com
href="mailto:samyuktaakunuru@yahoo.com">Samyukta Akunuru</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu
href="mailto:javascript@LaTech.edu">[JavaScript List]</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, March 02, 2004 5:52
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Javascript] struts form
using javascript code</DIV>
<DIV><BR></DIV>
<DIV>Here it is...</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Sam.<BR></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><html><BR><head></DIV>
<DIV><style><!--<BR>body,td,a,p,.h{font-family:times new
roman,arial,sans-serif;}<BR>.h{font-size: 20px;}<BR>.q{text-decoration:none;
color:#0000cc;}<BR>//--><BR></style></DIV>
<DIV><BR><SCRIPT LANGUAGE="JavaScript"><BR>var checkflag =
"false";<BR>function check(field) {<BR>if (checkflag == "false") {<BR>for (i =
0; i < field.length; i++) {<BR>field[i].checked = true;}<BR>checkflag =
"true";<BR>return "Uncheck All"; }<BR>else {<BR>for (i = 0; i <
field.length; i++) {<BR>field[i].checked = false; }<BR>checkflag =
"false";<BR>return "Check All"; }<BR>}</DIV>
<DIV> </DIV>
<DIV>function set(target)
{document.forms[0].dispatch.value=target;}<BR></script></DIV>
<DIV></head></DIV>
<DIV><body><BR><table border="0" width="100%"><BR>
<tr><BR> <td bgcolor="00007D"
align="center"><BR> <font color=white
size="6"><b><u>Drivers</u></b></font><BR>
</td><BR></tr><BR></table><BR><table><BR><form
name="driversDisplayForm" method="post" action="//deleteDriver.do">
<BR> <tr><BR><td align="right"><BR><!-- use
onSubmit-- javascript--><BR> <input
type="hidden"
name="finalDeleteArray"<BR>
value="return
getCheckedItems();"><BR>
<input type="button" name="Delete" value= "Delete"
onClick="getCheckedItems()"> <BR>
</td><BR> <td
align="right"><BR> <!--html:submit
property="submit" value="Add"/--><BR>
<input type="button" name="Add" value= "Add"
onClick="window.location.href='driver_new.jsp'"><BR>
</td><BR> <BR> <BR>
</tr><BR></table><BR><!--html:form action="display"
name="displayForm"--> <BR><table border="1" width="100%"></DIV>
<DIV> <BR><tr><BR><th><input
type=checkbox name="driver_all" value="Check All"
onClick="check(this.form.list)"></th><BR><th><a
href="drivers.jsp">Last name</a></th><BR><th><a
href="drivers.jsp">First Name</a></th><BR><th><a
href="drivers.jsp">Middle Name</a></th><BR><th><a
href="drivers.jsp">Clock #</a></th><BR><th><a
href="drivers.jsp">Supervisor</a></th><BR><th><a
href="drivers.jsp">Notes</a></th></DIV>
<DIV></tr><BR> </DIV>
<DIV> <tr
align="left"><BR> <td
align="center"><BR> <input type=checkbox
name="list" value="1"></DIV>
<DIV> </td><BR> <td
align="center"><BR>
peterson<BR> </td><BR> <td
align="center"><BR>
peter<BR> </td><BR> <td
align="center"><BR>
j<BR> </td><BR> <td
align="center"><BR>
<a
href="driverDisplay.do?employeeID=ppeterson"><BR>
ppeterson<BR> </a><BR>
</td><BR> <td
align="center"><BR>
green, rachel j(rgreen)<BR> </td><BR> <td
align="center"><BR>
new addition</DIV>
<DIV><BR> </td><BR></tr><BR> </DIV>
<DIV></table></DIV>
<DIV></form> <BR><SCRIPT LANGUAGE="JavaScript"><BR>function
getCheckedItems()</DIV>
<DIV>{<BR> var value = false;<BR> menus = new Array;<BR> var
msg = "";</DIV>
<DIV> var checkBoxes = document.forms[0].elements["list"];</DIV>
<DIV><BR>for(var i = 0; i < checkBoxes.length; i++)<BR>
{<BR> if(checkBoxes[i].checked)<BR>
{<BR> menus =
menus+","+i;<BR> <BR> value = true;
<BR> }<BR> }</DIV>
<DIV>menusChopped = menus.substr(1,menus.length-1);//chop leading
comma<BR>deleteArray = new Array;</DIV>
<DIV>deleteArray = menusChopped.split(",");<BR>finalDeleteArray =
new Array;</DIV>
<DIV><BR> for (i=0;i<deleteArray.length;i++){<BR>
finalDeleteArray[i]= deleteArray[i];<BR>
alert(finalDeleteArray[i]);<BR> }</DIV>
<DIV> </DIV>
<DIV>if(!value)<BR> alert("Check at least one of the
checkboxes, thanks.");</DIV>
<DIV><BR>//this.form.action="<A
href='http://myserver.com/searchById/submit.do";//fix'>http://myserver.com/searchById/submit.do";//fix</A>
this<BR>//window.location.href='deleteDriver.do';<BR>return
finalDeleteArray;<BR>}<BR></script></DIV>
<DIV><BR></body><BR></html><BR></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BLOCKQUOTE></BODY></HTML>