Discussion:
how to use javascript functions in struts html:form
(too old to reply)
Lucky
2005-04-19 15:20:21 UTC
Permalink
hi
i have javascripts file validations.js. and i want to use these javascript
functions in my jsp pages which use struts html tags..
i don't know how to invoke these functions from <html:form...(struts html
tag).
if it is a ordinary html form i would have done like below
<form name="myform" action="xxxx.jsp" onsubmit="return validate()">
if i wrote the same with the struts html tag.....it is giving error the is
no attribute like "name" in html tag lib..
can any body tell me how to user external javascript functions in the struts
html tags
Karlos
2005-07-26 03:42:10 UTC
Permalink
"Lucky" <***@comcast.net> wrote in news:yPOdnRzEzIsvvPjfRVn-***@comcast.com:
Seem like you are using struts 1.2.x. Name is not an attribute there.
Your code can be something like this.
<html:form action="/whatever.do" styleId="nameAttribute"
onsubmit="return validate();">

</html:form>

and you can access the form element with document.getElementById
("nameAttribute") in your validate method.
Post by Lucky
hi
i have javascripts file validations.js. and i want to use these
javascript functions in my jsp pages which use struts html tags..
i don't know how to invoke these functions from <html:form...(struts
html tag).
if it is a ordinary html form i would have done like below
<form name="myform" action="xxxx.jsp" onsubmit="return validate()">
if i wrote the same with the struts html tag.....it is giving error
the is no attribute like "name" in html tag lib..
can any body tell me how to user external javascript functions in the
struts html tags
Loading...