struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Form/Submit tags suggestion
Date Fri, 07 Jul 2000 05:31:02 GMT
Robert Edgar wrote:

> A suggestion,
>
> The form tag wont acept an onsubmit event and the submit button wont accept
> an onclick event.
>
> I need to do some processing immediately before submitting the
> form(accumulating 120 checkboxes into a single hidden tag so it can be
> passed to a form property).
>
> Of course I can just remove the struts submit button and replace with a
> standard button but it would be nice to just be able to us the tags and set
> the events....
>

Both of these are legal ... it's just that Struts, like all XML applications,
is case sensitive and I chose a different capitalization for these attributes
(see the tags.html file in the "struts-documentation" file for the correct
capitalization).

Try <struts:form ... onSubmit="xxx"/> and <struts:submit ... onClick="xxx"/>.

>
> BTW
> Can a form property be somehting other than a string??
> Rob

At the moment it cannot.  On the client side, I don't see a lot of room for
changing this.  However, what I'm interested in exploring is the idea of adding
a "validate" attribute on the input fields like "text" that would generate
JavaScript code to validate things like "this field is required" and "this
field must be a date".  On the server end, though, the parameter values are
still going to come in as strings because of the way that the HTTP protocol
(and the servlet API) are defined.

Craig



Mime
View raw message