struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
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:

http://struts.apache.org/1.2.9/userGuide/dev_validator.html#validwhen

L.


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


Mime
View raw message