struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Bryant <dbry...@scra.org>
Subject validator: how to validate if either of two fields is present and valid
Date Wed, 04 Jun 2003 15:34:34 GMT
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


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message