struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Chisholm" <David_Chish...@i2.com>
Subject RE: Form/Submit tags suggestion
Date Fri, 07 Jul 2000 13:35:32 GMT


> -----Original Message-----
> From: Robert Edgar [mailto:robedgar@hkstar.com]
> Sent: Friday, July 07, 2000 1:04 AM
> To: struts-user@jakarta.apache.org
> Subject: RE: Form/Submit tags suggestion
>
>
> Thanks,
> Sorry should have RTFM....
>
> The hours are long and I am getting tired :-))
>
> On types, I was just thinking of whether there was a simpler way
> of handling
> arrays of controls, ie I have 3 sets of 40 checkboxes allowing someone to
> select the type of news they are interested in, I dont feel like having 40
> properties on the form object (and in any case it would then break if I
> added a new news item) so I have a js function to run over all
> the controls
> and concat the values in to a CSV string which I pass to a single
> property(though this is quite slow).
>


Is this somehow different than assigning all of the checkbox fields with the
same name, and then using ServletRequest.getParameterValues(String) to get
an array of the parameter values?
David


> Yea like the client side script auto validation, we are doing this now but
> we keep the validation routines in a seperate js file then call
> the routine
> from the onblur for a field or the onsubmit for the form but it would be
> neat to have this auto generated
>
> Rob
>
>
> -----Original Message-----
> From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> Sent: Friday, July 07, 2000 1:31 PM
> To: struts-user@jakarta.apache.org
> Subject: Re: Form/Submit tags suggestion
>
>
> 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