Wednesday, January 20, 2010

Perform Length Validation on Text Field Component.

Bellow code snippet validate minimum and maximum length of a Input Text Field:


<h:inputText id="empName" value="#{employeeBean.name}"
size="25" minlength="5" maxlength="255"/>


<h:message
style="color: red;
font-family: ’New Century Schoolbook’, serif;
font-style: oblique;
text-decoration: overline" id="errors1" for="empName"/>

No comments:

Post a Comment