You need the get the label value from the " Language.properties " file rather than giving direct value in the " label " attribute in the AUI input tag.
example:-
Language.Properties : -
first-name-req = First Name <em class="star"> * <em>
email-req = Email Id <em class="star"> * <em>
phone-req = Mobile Number <em class="star"> * <em>
.jsp page :-
<aui:form name="fm" method="POST" action="<%=customerURL%>" inlineLabels="true">
<aui:input name="firstName" label="first-name-req" value='<%= %>' autocomplete="off">
<aui:validator name="required" />
<aui:validator name="minLength" errorMessage="Firs Name can not be less than 5 characters. Please try again" >5</aui:validator>
<aui:validator name="maxLength" errorMessage="First Name is too long. Please try again" >75</aui:validator>
</aui:input>
<aui:input name="emailId" label="email-req" value='<%= %>' autocomplete="off">
<aui:validator name="required" />
<aui:validator name="alphaNumeric" />
<aui:validator name="maxLength" errorMessage="First Name is too long. Please try again" >256</aui:validator>
</aui:input>
<aui:input name="phoneNo" label="phone-req" value='<%= %>' autocomplete="off">
<aui:validator name="required" />
<aui:validator name="number" />
<aui:validator name="minLength" errorMessage="First Name is too long. Please try again" >10</aui:validator>
</aui:input>
</aui:form>
css :-
.star {
color : red ;
}
.aui-label-required {
display : none;
}
example:-
Language.Properties : -
first-name-req = First Name <em class="star"> * <em>
email-req = Email Id <em class="star"> * <em>
phone-req = Mobile Number <em class="star"> * <em>
.jsp page :-
<aui:form name="fm" method="POST" action="<%=customerURL%>" inlineLabels="true">
<aui:input name="firstName" label="first-name-req" value='<%= %>' autocomplete="off">
<aui:validator name="required" />
<aui:validator name="minLength" errorMessage="Firs Name can not be less than 5 characters. Please try again" >5</aui:validator>
<aui:validator name="maxLength" errorMessage="First Name is too long. Please try again" >75</aui:validator>
</aui:input>
<aui:input name="emailId" label="email-req" value='<%= %>' autocomplete="off">
<aui:validator name="required" />
<aui:validator name="alphaNumeric" />
<aui:validator name="maxLength" errorMessage="First Name is too long. Please try again" >256</aui:validator>
</aui:input>
<aui:input name="phoneNo" label="phone-req" value='<%= %>' autocomplete="off">
<aui:validator name="required" />
<aui:validator name="number" />
<aui:validator name="minLength" errorMessage="First Name is too long. Please try again" >10</aui:validator>
</aui:input>
</aui:form>
css :-
.star {
color : red ;
}
.aui-label-required {
display : none;
}
No comments:
Post a Comment