Hai everyone
In my page I have two text fields, one for user name and another one for country.
I use the rich:suggestionbox box component for country field ,
In my coding, I intend to submit the form after hit the submit button. If any field value is not entered, I display validation error messages on the page itself.
But when I try to enter something in the rich:suggestionbox, the form gets submitted and I get validation error for all the fields. But I need the validation error after hit the submit button.
I wish to know how I can achieve validation after I hit the submit button only.
this my sample code
<a:form id="proform" ajaxSubmit="true" ignoreDupResponses="true">
<a:region id="stat1">
<a:outputPanel ajaxRendered="true">
<h:outputLabel for=" username">Name *</h:outputLabel>
<h:inputText id="username" value="#{user.username}" required="true"/>
<h:message for="username" style="color:red" />
<h:outputLabel for="country">Country *</h:outputLabel>
<h:inputText value="#{user.country}" id="country" />
<rich:suggestionbox for="country" var="result" fetchValue="#{result.text}" suggestionAction="#{suggestionBox.autocomplete}">
<h:column>
<h:outputText value="#{result.text}" />
</h:column>
</rich:suggestionbox>
<h:message for="country" style="color:red" />
</a:outputPanel>
</a:region>
</ a:form>
By
Thiagu.m