<!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></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Well, aside from some excitingly dreadful
formatting, the first "gotchas" I found are in the omission of an include for
the driver_new.jsp, the unreferenced object/function attached to the "Delete"
key, and the non-displayability of the driverDisplay.do file.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I think perhaps we should try to break this down
and address each issue individually, rather than diving in and swimming about in
all directions. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Perhaps "Job #1" should be to check that the
various necessary browser functions are enabled, and that all the core code
modules are within reach. After that, I'd look into each individual module
and analyze it from an input/output standpoint, and make sure that it is
canonically structured, has a front-end exception filter to remove "bad" inputs,
and correctly acts on valid data to produce desired output code.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is such a bag of worms, I'm not sure where
else to start.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-- Dave Lovering</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 3: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><FONT face=Arial size=2></FONT> </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> </DIV>
<DIV><BR><B><I>Chris Tifer <christ@saeweb.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<DIV><FONT face=Arial size=2>Show us the final code that gets sent to the
browser.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </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 1:24
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Javascript] struts form
using javascript code</DIV>
<DIV><BR></DIV>
<DIV>Chris,</DIV>
<DIV> </DIV>
<DIV>Thanks for the reply.</DIV>
<DIV>"And after looking a little closer, I don't even see a <form>
element so maybe that's your problem." ---------> Yes struts was
going to generate the <form> element after the jsp was compiled
using jasper.</DIV>
<DIV>Has anyone used struts with javascript...</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks.<BR><BR><B><I>Chris Tifer <<A
href="mailto:christ@saeweb.com">christ@saeweb.com</A>></I></B>
wrote:</DIV>
<BLOCKQUOTE class=replbq
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
<DIV><FONT face=Arial size=2>My best guess by looking at that and
your brief description is that the field parameter being passed into the
check() function is not a field as it expects, but rather a pointer to a
form object. form.length is not a property, but forms.length
is.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>And after looking a little closer, I don't
even see a <form> element so maybe that's your
problem.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Chris Tifer</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@laTech.edu</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, March 02, 2004
9:32 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Javascript] struts form
using javascript code</DIV>
<DIV><BR></DIV>
<DIV>Hi</DIV>
<DIV>Code below gives me :form.length is null or not an object.</DIV>
<DIV>Any tips appreciated.</DIV>
<DIV>Tahns</DIV>
<DIV> </DIV>
<DIV><%@ page language="java"%><BR><%@ taglib
uri="/WEB-INF/struts-html.tld" prefix="html" %><BR><%@ taglib
uri="/WEB-INF/struts-bean.tld" prefix="bean" %><BR><%@ taglib
uri="/WEB-INF/struts-logic.tld" prefix="logic" %></DIV>
<DIV><BR><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><BR><%
com.dynetics.gmpm.rad.Principal pl = (com.dynetics.gmpm.rad.Principal)
session.getAttribute("principal");<BR>if(pl !=
null)System.out.println("*** principal is not
null");<BR> if(pl ==
null) {<BR>
%><BR>
<jsp:forward
page="logout.jsp"/><BR>
<%<BR>
}<BR>
com.dynetics.gmpm.rad.PrincipalHolder.setPrincipal(pl);<BR>
%></DIV>
<DIV><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>
<tr><BR><td
align="right"><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> <a
href="driver_new.jsp" target="frame_main"><input type="button"
name="Add" value= "Add"
onClick="window.location.href='driver_new.jsp'"></a><BR>
</td><BR> <BR> <BR>
</tr><BR></table><BR><html:form action="display"
name="displayForm" type="com.servlet.DisplayForm" >
<BR><table border="1" width="100%"></DIV>
<DIV> <BR><tr><BR><th><input
type=checkbox name="d_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></DIV>
<DIV><BR></tr></DIV>
<DIV><tr align="left"><BR> <td
align="center"><!--input type=checkbox
name="list"--><BR> <input
type=checkbox name="list" value="0"></DIV>
<DIV> </td><BR> <td
align="center"><BR>
Smith<BR> </td><BR> <td
align="center"><BR>
Ashley<BR> </td><BR> <td
align="center"><BR>
K<BR> </td><BR> <td
align="center"><BR>
<a
href="driverDisplay.do?employeeID=asmith"><BR>
asmith<BR>
</a><BR> </td><BR> <td
align="center"><BR>
<BR> </td><BR> <td
align="center"><BR>
new driver<BR> </td><BR></tr><BR>
</DIV>
<DIV> <tr
align="left"><BR> <td
align="center"><!--input type=checkbox
name="list"--><BR> <input
type=checkbox name="list" value="1"></DIV>
<DIV> </td><BR> <td
align="center"><BR>
David<BR> </td><BR> <td
align="center"><BR>
John<BR> </td><BR> <td
align="center"><BR>
V<BR> </td><BR> <td
align="center"><BR>
<a
href="driverDisplay.do?employeeID=jdavid"><BR>
jdavid<BR>
</a><BR> </td><BR> <td
align="center"><BR>
<BR> </td><BR> <td
align="center"><BR>
Novice<BR> </td><BR></tr><BR>
</DIV>
<DIV> <tr
align="left"><BR> <td
align="center"><!--input type=checkbox
name="list"--><BR> <input
type=checkbox name="list" value="2"></DIV>
<DIV> </td><BR> <td
align="center"><BR>
Doe<BR> </td><BR> <td
align="center"><BR>
John<BR> </td><BR> <td
align="center"><BR>
K<BR> </td><BR> <td
align="center"><BR>
<a
href="driverDisplay.do?employeeID=jdoe"><BR>
jdoe<BR>
</a><BR> </td><BR> <td
align="center"><BR>
Doe, John K(jdoe)<BR> </td><BR> <td
align="center"><BR>
novice<BR> </td><BR></tr></DIV>
<DIV></table></DIV>
<DIV></html: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 =
driversDisplayForm.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>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A
href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what you’re
looking for faster.</A>
<P>
<HR>
<P></P>_______________________________________________<BR>Javascript
mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE>_______________________________________________<BR>Javascript
mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A
href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what you’re
looking for faster.</A>
<P>
<HR>
<P></P>_______________________________________________<BR>Javascript
mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE>_______________________________________________<BR>Javascript
mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A
href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what you’re looking
for faster.</A>
<P>
<HR>
<P></P>_______________________________________________<BR>Javascript mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE></BODY></HTML>