Thursday, December 19, 2013

AUI Script Number Validation

The below example is to validate the number,which will accept only numbers and  .0 or .5 ,not more than 4 digits.

<aui:input name="" label="">
<aui:validator name="required"></aui:validator>
<aui:validator name="custom" errorMessage="This field should be in correct NumberFormat only!!">
function(val, fieldNode, ruleValue)
{ var a= val;
if(/^([1-4]{0,1})([0-9]{1})(\.[0,5])?$/.test(a))
return true;
else
return false;
}
</aui:validator>
</aui:input>

No comments:

Liferay DXP JNDI Data Source Cofiguration

 This Blog will help us to learn about the JNDI Data Source Configuration in Liferay DXP. We have tested this with Liferay 7.3 with Tomcat. ...