Pages

Tuesday, 2 April 2013

AUI Form Validator Taglib


<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>
<portlet:defineObjects />

This is the  portlet.

<aui:form method='POST' name="fm" id="fm" >
<aui:layout>
<aui:column cssClass="aui-w25" >
<aui:input name="field1" first="<%=true %>" >
<!-- Example with multiple validators -->

       <!-- Make the field required.  If the field is empty, form will not submit -->
       <aui:validator name="required" />

       <!-- Only allow digits in the field -->
       <aui:validator name="digits" />

       <!-- Make sure field value is between 8 and 50 characters in length -->
       <aui:validator name="range" >
           [8,50]
       </aui:validator>
     
   </aui:input>
   <aui:button-row><aui:button type="submit" /></aui:button-row>
 
</aui:column>
</aui:layout></aui:form>

No comments:

Post a Comment