I am working on a JSP project, and I need a functionality that
- whenever the check-box is checked, users are REQUIRED to choose an option (from a dropdown menu)
- However, whenever the check-box is unchecked, picking an option will not be required.
Right now, my check-box looks like this:
<h:selectBooleanCheckbox class="someClass" value="#{someBean.check}" />
the check is a boolean value in my JAVA class, and my html page should be able to recognize the state of checkbox.
I am wondering how to apply the current state to my dropdown menu, so my dropdown menu will know if user needs to pick one option or not..
Will the use of Ajax listner work in this case? How to get state of SelectBooleanCheckbox in Ajax Listener? Or there's any other suggestions? Thanks a lot!
my previous related question Conditionally make inputs required depending on checkbox value