LifeRay form validation using Alloy UI

喜你入骨 提交于 2019-12-11 08:37:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!