• Post Reply Bookmark Topic Watch Topic
  • New Topic

CheckBox validation  RSS feed

 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body I am facing one peculiar problem , I am using <h:selectBooleanCheckbox> in my app.I want to validate it , for that reason I am using required="true" , but it is not validating or showing any message . What is the reason ?


Here is my JSF code :



With out clicking this check box , if click the submit button it is not validating or showing any meassage.


Thanks ,
S
 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somebody asked the exact same question about 2-3 months ago. Try using the forum search. As I recall, the short answer is that "required="true"" doesn't work that way. In part because what good would a checkbox be if it was always required to be checked? But the real reason was that "required' doesn't mean white what you think.

Actually, I do have an app where it's mandatory for the user to check a checkbox as a legal acknowledgement. For that I wrote a custom validator.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!