Reputation: 57
I wrote some simple code in liferay to make use of the in-built aui validator, like so:
<div id="addDiv">
<aui:form name="fmAdd" id="fmAdd" action="<%= addURL.toString() %>" method="post">
<aui:fieldset>
<div>
<aui:input id="addName" name="name">
<aui:validator name="required" />
</aui:input>
</div>
<div>
<aui:input id="addDescription" name="desc" >
<aui:validator name="required" />
</aui:input>
</div>
<aui:button-row>
<aui:button type="submit" id="btnSubmit"/>
</aui:button-row>
</aui:fieldset>
</aui:form>
</div>
In another project the same code works fine, and for this jsp it recognises that it's a required field since it appends (required) at the end of the input labels. However, the javascript validation doesn't work. When I click the button without filling in anything the whole form just submits anyway.
Am I missing something? I'm very confused right now so any help would be greatly appreciated!! Thanks!
Edit: For some reason, this problem solved itself without me doing anything. I'm not sure what happened, but it suddenly started working. Can someone advise me as to what I should do with this post? Is there a way to remove it?
Upvotes: 0
Views: 2930
Reputation: 21
I think I have figured it out. I faced the same problem. Validation stopped working when I added another form in an included page. When I added 'name' attribute to each forms it started working again.
Upvotes: 2
Reputation: 3650
It can very well be a bug that is mentioned here in the link. http://issues.liferay.com/browse/LPS-15050
Upvotes: 0