Re: how to use javascript functions in struts html:form



"Lucky" <jlnarayana@xxxxxxxxxxx> wrote in
news:yPOdnRzEzIsvvPjfRVn-iQ@xxxxxxxxxxx:
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.

> 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
>
>
>

.



Relevant Pages

  • Re: how to use javascript functions in struts html:form
    ... >functions in my jsp pages which use struts html tags.. ... >can any body tell me how to user external javascript functions in the struts ... DON'T use javascript to validate your struts form. ...
    (comp.lang.java.softwaretools)
  • Struts validator question
    ... just a question about client side validation with Struts. ... javascript functions defined in validation-rules.xml in your page. ... The matter is tha I don't need ALL that function in all my pages. ...
    (comp.lang.java.programmer)