问题
I use LifeRay 6.1.2. And it have built-in Alloy UI 1.5. framework. So I try to reproduce this form validation example (I copied all code), but it don't work as expected (error labels in DOM, but they are don't visible in form (see EDIT1)):
Expected result is (you can try yourself live example using link provided above):
Where is problem? How to solve it? Thanks.
EDIT1:
After some research, I realized that if I delete aui-form-validator-message
CSS class from error message's DIV tag (it generated by LifeRay, I'm not adding it), then error message become visible. Strange..
回答1:
You should post your own code, or it's difficult to answer. Anyway if you want you could try the aui validator tag for example:
<aui:input name="name" value="${name}" label="name">
<aui:validator name="required" errorMessage="your-message-here"></aui:validator>
</aui:input>
learn more @ http://drewblessing.com/blog/-/blogs/34509
Hope it helps!
回答2:
I think you have not used the tag in your code.
<script src="http://cdn.alloyui.com/2.0.0/aui/aui-min.js"></script>
Paste this and check.
来源:https://stackoverflow.com/questions/19570229/liferay-form-validation-using-alloy-ui