I think you will need to make your own validator for this. Or, what I do, is
check the value of your radio button in your form listener and add custom
errors using:

IFormComponent component = (IFormComponent) getComponent(componentId);
delegate.setFormComponent(component);
delegate.record(message, constraint);

To set the error and decorate the component.

Hope that helped.

Jim McCollom

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dan Diephouse
Sent: 20. september 2005 21:07
To: tapestry-user@jakarta.apache.org
Subject: conditional validation

Is there an easy way to make validation conditional? For instance I have a
set of radio options. If the user chooses option1, I'd like the fields under
option 1 to be validated. If they choose option 2, I'd like the fields under
option 2 to be validated and so on.

I looked a bit at the Required validator class, but I couldn't  figure out
how to check if another field was set to another value.

Any advice would be appreciated. Thanks,

- Dan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to