Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Karthik V S
JavaScript validation in Liferay JSP page is not working
November 15, 2013 4:24 AM
Answer

Karthik V S

Rank: Regular Member

Posts: 103

Join Date: December 21, 2011

Recent Posts

Hi all,

I am using JavaScript validation for a portlet in jsp page. But in the application it is not working . i.e validation is not happening after eriting the code.

Follwoing is the code in JSP Page:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<script type="text/javascript">
YUI().use(
'aui-form-validator',
function(Y) {
new Y.FormValidator(
{
boundingBox: '#myForm'
}
);
}
);
</script>

<aui:form action="<%= URL.toString() %>" method="post" validate="true" id="myForm">
<aui:fieldset>
<aui:layout>
<aui:column>
<aui:input type="text" name="name" id="nameid" label="Vendor Name: " inlineLabel="true" cssClass="alignment" inputCssClass=""></aui:input>
<aui:input type="text" name="addressLine1" label="Address 1: " inlineLabel="true" cssClass="alignment"></aui:input>
<aui:input type="text" name="addressLine2" label="Address 2: " inlineLabel="true" cssClass="alignment"></aui:input>


<aui:button-row>
<aui:button type="submit" value="Submit"></aui:button>
</aui:button-row>
</aui:column>
</aui:layout>
</aui:fieldset>
</aui:form>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Can anyone help in this regard. Is there any error from the above code?

With Regards,

V S Karthik