struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Benedict <>
Subject Re: Validator and At Least 1 Checkbox Checked
Date Thu, 21 Sep 2006 02:54:26 GMT
Laurie, absolutely, use the required validation. I do that for my 
applications. Since he was specifically talking about length of an 
array, there is no such validation; but as long as a valid is present, 
it was submitted.

Laurie Harper wrote:
> Can't you just use the 'required' validation rule? Or possibly a 
> validwhen with something like *this* != null and *tihs*.length >= 1? 
> Admittedly I haven't tried either, though.
> L.
> Paul Benedict wrote:
>> I've always wanted this feature myself. However, no such validation 
>> exists.. but if you write it, you could share it back to the Struts 
>> community.
>> So you'll have to add this validation yourself by override the 
>> validate() method of your form, checking the property's length; if it 
>> is not null then add your message to the existing error messages.
>> Paul
>> Mississippi John Hurt wrote:
>>> Can struts validator validate that at least one checkbox in a set is
>>> checked?  I guess somehow it has to validate that a String[] array 
>>> property
>>> of the form has size of 1 or more, but I dont know how.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message