samedi 21 février 2015

How to validate drop down list based on checked checkbox

I need your help in validating a drop down list based on the checked checkbox. Currently, I am having many checkbox item which has list of certificates



<h:selectManyCheckbox id="certificates"
layout="pageDirection" required="true" requiredMessage="Error: Select at least One Certificate">
<f:selectItem itemLabel="Certificate A"
itemValue="c_a"/>
<f:selectItem itemLabel="Certificate B"
itemValue="c_b"/>
</h:selectManyCheckbox>


My scenario is that if the user selects Certificate A, then the drop down list language should be enabled and it should be required.



<h:selectOneMenu label="language" disabled="true">
<f:selectItem itemLabel="Please Select a Language"
itemValue=""/>
<f:selectItem itemLabel="A" itemValue="A"/>
<f:selectItem itemLabel="B" itemValue="B"/>
</h:selectOneMenu>


So how can I achieve this and Thanks





Aucun commentaire:

Enregistrer un commentaire