Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Liferay Validating user-submitted forms

    • 0
    • 2
    • 1
    • 3
    • 0
    • 0
    • 0
    • 0
    • 752
    Comment on it

    In Liferay we can Validating the user submitted form or Validating AUI input fields. You have to add aui:validator tag and specify the appropriate attributes which we define with name property for ex: required,minLength etc . The Below Example can show how you can validate the input fields in aui forms.


    <%@ taglib uri="" prefix="portlet" %>
    <%@ page import="javax.portlet.PortletPreferences" %>
    <%@ taglib uri="" prefix="aui" %>
    <portlet:defineObjects />
    <portlet:actionURL name="loginCheck" var="loginURL" />
    <aui:form name="loginCheck" method="POST" action="<%=loginURL.toString()  %>" class="dropzone" enctype="multipart/form-data">
            <aui:input name="name" >
                 <aui:validator name="required" errorMessage="Please enter your name." />
                 <aui:validator name="minLength">6</aui:validator>
            <aui:input name="email" >
                <aui:validator name="email" />
                 <aui:validator name="required"/>
            <aui:input id="message" type="textarea" name="message">
                 <aui:validator name="required" errorMessage="Please enter a message." />
        <aui:input type="file" name="file" >
            <aui:validator name="acceptFiles">'jpg'</aui:validator>
        <aui:button type="submit" value="addDetails" />

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: