Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

html:form styleId name attribute javascript issue

john lee

2007-08-06

Replies:

I have two file, and try to test javascript, but javascript can not access document.form.
 
Can one know why? inside <html:form>, styleId <> Name attribute? if so, what is the solution for that?
 
i use strusts 1.3
 
tks in advance
 
john
 
 
one file is javacript file, called my.js
------------------------------------------------------------------------
function loader(){
  var form=document.form["partsearchinput"];
  from.setAttribute("autocomplete","off");
}
-------------------------------------------------------------------------
 
 
second file is test file, called my.jsp
-----------------------------------------------------
<script type="text/javascript" src="my.js"></script>
<html>
<body onload="loader() >
 
<html:form styleId="partsearchinput" action="partsearchinput">
 <html:text property="part" styleId="part" />
</html:form>
</body>
</html>
 
   
 

   
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.
©2008 junlu.com - Jax Systems, LLC, U.S.A.