struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: conditional required in struts validator
Date Thu, 07 Sep 2006 23:40:01 GMT
fea jabi wrote:
> Have a Drop down and an input field.
> When user selects "Type 1" from drop down only then the input field is 
> required. otherwise it's not a required field.
> Looking at the validator guide in struts maybe I have to create a new 
> validator rule which should check if drop down value "Type 1". But not 
> sure how to code to say that the input field is required here.
> How to do this?

You want the 'validwhen' validation rule. See here for documentation, 
including an example of what you want to do:


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

View raw message