What makes a checkbox unusual is that it only submits a value when
checked - when unchecked nothing is submitted.
You should therefore be able to validate that it's been checked with a
standard "required" validator.




-----Original Message-----
From: Morowitz, Michael [mailto:[EMAIL PROTECTED] 
Sent: 17 March 2004 16:26
To: [EMAIL PROTECTED]
Subject: Single Checkbox Required

I have searched the archive of the list and I came up empty.

I want to use validator.xml to indicate that a single checkbox must be
checked 'true' on my form. Has anyone had success simply indicating a
boolean field to be "required"?

I've noticed that in the client-side javascript that is generated,
validateRequired does not look at fields of type 'checkbox'.

I have read that commons-validator added this functionality at some
point in the past, but has it not made it into the Struts validtion
package?

Thanks,
Michael

---------------------------------------------------------------------
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