Liferay Provides its own AUI Validators to validate the AUI Form Elements, There are numerous validators are available for the validations of Text, Numbers, Email, Password and etc...
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> <aui:form> <aui:input name="alpha" type="text"> <aui:validator name="alpha"/> </aui:input> <aui:input name="alphanum" type="text"> <aui:validator name="alphanum"/> </aui:input> <aui:input name="digits" type="text"> <aui:validator name="digits"/> </aui:input> <aui:input name="email" type="text"> <aui:validator name="email"/> </aui:input> <aui:input name="number" type="text"> <aui:validator name="number"/> </aui:input> <aui:input name="date" type="text" > <aui:validator name="date"></aui:validator> </aui:input> <aui:input name="maxLength4" type="text" > <aui:validator name="maxLength">4</aui:validator> </aui:input> <aui:input name="minLength3" type="text" > <aui:validator name="minLength">3</aui:validator> </aui:input> <aui:input name="required" type="text" > <aui:validator name="required"/> </aui:input> <aui:input name="required" type="text" label="Required Label is Hidden" showRequiredLabel="false"> <aui:validator name="required"/> </aui:input> <aui:input name="range" type="text"> <aui:validator name="range">[0,9]</aui:validator> </aui:input> <aui:input name="rangeLength" type="text"> <aui:validator name="rangeLength">[3,5]</aui:validator> </aui:input> <aui:input name="url" type="text"> <aui:validator name="url"/> </aui:input> <aui:input name="acceptFiles" type="file"> <aui:validator name="acceptFiles">pdf</aui:validator> </aui:input> <aui:input name="myDate" type="date"/> <aui:input name="myTimeZone" type="timeZone"/> <aui:input name="textarea" type="textarea"/> <aui:button type="submit" value="submit"/> </aui:form>
0 comments:
Post a Comment