struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Beal <>
Subject Re: Help Validating Accepted/Not Accepted radio buttons
Date Thu, 02 Dec 2004 21:33:56 GMT
I'd just put that in the Action class instead of in validation.  It 
seems like more of a "business" decision than a "validation" decision. 
(After all, 'Y' and 'N' are both valid responses.)

In Action:

if ("Y".equals(myForm.getAccept)) {
   return mapping.findForward("accept")
} else {
   return mapping.getInputForward();

-- Jeff

Wendy Smoak wrote:
> I have a form on which the user must accept the terms and conditions when
> registering for an account.  This is done with a pair of radio buttons set
> to "Y" or "N".  (It defaults to "N".)
> What is the best way to set up validation for this field so that if the user
> does not change the selection to "Y", the form is re-displayed with an error
> message?
> How do I validate that a form field is exactly equal to a string?
> Thanks,
> Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message