I have a PrimeFaces textbox with autocomplete functionality. For required field validation error i have to show the error message and highlight the textbox with red color border. I have showed the error message with <h:message>
how to highlight the textbox with red color border.
My textbox is mentioned below.
<p:focus context="accountNo">
<p:autoComplete id="accountNo" value="#{orderController.accountNo}"
completeMethod="#{orderController.getAccountAutoComplete}"
forceSelection="true" styleClass="ui-inputfield" requiredMessage="Account number is required" required="true"/>
<h:message for="accountNo" style="color:red" />
</p:focus>
You can use <p:message>
with for
attribute set to id of textbox.
For example:
<p:inputText id="id" value="#{bean.idd}" />
<p:message for="id" display="icon" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.