You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Doug Bryant <db...@scra.org> on 2003/06/04 20:27:08 UTC
RE: validator: how to validate if either of two fields is present
andvalid
Perfect! Thanks James. That's exactly what I was looking for.
Doug
On Wed, 2003-06-04 at 14:16, James Turner wrote:
> Check out the requiredif validation. It's even in the newbie FAQ now.
>
> James
>
> > -----Original Message-----
> > From: Doug Bryant [mailto:dbryant@scra.org]
> > Sent: Wednesday, June 04, 2003 11:35 AM
> > To: Struts Users Mailing List
> > Subject: validator: how to validate if either of two fields
> > is present andvalid
> >
> >
> > we have a form we are displaying to the user. depending on
> > the permissions the user has, they are required to either
> > fill out a "requiredDeliveryDate" or "daysAro"
> >
> > Depending on what permissions you have, you must fill out one
> > or the other and you must fill in either a date or an integer
> > value depending on the field.
> >
> > We are currently using validator for the rest of the app (1.1 rc1).
> >
> > How can we achive this validation using validator?
> >
> > Writing a custom validate method does not seem to be a good
> > solution because you can only validate one field at a time.
> >
> > We thought about extending
> > org.apache.struts.validator.DynaValidatorForm, overriding the
> > validate method, validating everything we can using
> > validator and coding the rest, but it seems far from ideal.
> >
> > Does anyone have any suggestions or has anyone ever run
> > across this type of problems before.
> >
> > Thanks for any suggestions.
> >
> > Doug
> >
> >
--
Doug Bryant
ICF Consulting
Software Engineer
phone: 843.760.3635
fax: 843.207.5444
email: wbryant@icfconsulting.com
dbryant@scra.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org