Validate a Text Field of a Form That is Not to be Submitted
I have this web page coded in JSF.
In this page, I undertake some client side operations (they work properly) and therefore the "type" of my <h:commandButtion ...> is "button".
<h:commandButton type="button" value="Find" immediate="true"
onclick="filterTable_clickButton( 'genderTypes:filter', 'genderTypes:genderTable' )"/>
However, I want to test if a text field is left blank when the button is clicked. But the validation does not work.
<f:view>
<h:message for="filter" errorClass="errors"/>
<h:form id="genderTypes">
<h:inputText id="filter" required="true" />
.....
.....
I have a table with id="genderTable" here
.....
.....
<h:commandButton type="button" value="Find" immediate="true"
onclick="filterTable_clickButton( 'genderTypes:filter', 'genderTypes:genderTable' )"/>
</h:form>
</f:view>
What should I do?

