掲示板
Field validation
Hi,
In create account page if i skip the first name then it will give an error message "First Name Required " .
Is it possible to do this type of validation for custom field ?
Please help.
In create account page if i skip the first name then it will give an error message "First Name Required " .
Is it possible to do this type of validation for custom field ?
Please help.
11年前 に Subhash Pavuskar によって更新されました。
RE: Field validation
Regular Member 投稿: 234 参加年月日: 12/03/13 最新の投稿
Thanks Subhash
But i have add this code for custom fields
<liferay-ui:custom-attribute
className="com.liferay.portal.model.User"
classPK="<%= 0l %>"
editable="<%= true %>"
label="<%= true %>"
name="Phone No"
/>
where & how should i add the js
thanks in advance.
But i have add this code for custom fields
<liferay-ui:custom-attribute
className="com.liferay.portal.model.User"
classPK="<%= 0l %>"
editable="<%= true %>"
label="<%= true %>"
name="Phone No"
/>
where & how should i add the js
thanks in advance.
11年前 に Subhash Pavuskar によって更新されました。
RE: Field validation
Regular Member 投稿: 234 参加年月日: 12/03/13 最新の投稿
Hi,
One of the clean ways to include js file in a portlet, independent of the portal server is to configure in
portlet deployment descriptor file as below i.e liferay-portlet.xml.
One of the clean ways to include js file in a portlet, independent of the portal server is to configure in
portlet deployment descriptor file as below i.e liferay-portlet.xml.
<portlet>
<portlet-name>MySamplePortlet</portlet-name>
<header-portlet-javascript> </header-portlet-javascript>
</portlet>
<liferay-ui:custom-attribute onclick="validate()"
className="com.liferay.portal.model.User"
classPK="<%= 0l %>"
editable="<%= true %>"
label="<%= true %>"
name="Phone No"
/>
its not working
className="com.liferay.portal.model.User"
classPK="<%= 0l %>"
editable="<%= true %>"
label="<%= true %>"
name="Phone No"
/>
its not working
look at this blog i think it can help : http://drewblessing.com/blog/-/blogs/34509
Thanks Akram
This <aui:validator> is applicable for <aui:input>.
I need validator for <liferay-ui:custom-attribute>
This <aui:validator> is applicable for <aui:input>.
I need validator for <liferay-ui:custom-attribute>
11年前 に Apoorva Prakash によって更新されました。
RE: Field validation
Liferay Master 投稿: 658 参加年月日: 10/06/15 最新の投稿sujay paul:
Thanks Akram
This <aui:validator> is applicable for <aui:input>.
I need validator for <liferay-ui:custom-attribute>
Hello Sujay,
Hope this will help...
<aui:script use="liferay-form">
Liferay.Form.register(
{
id: '<portlet:namespace />fm',
fieldRules: [
{
body: '',
custom: false,
errorMessage: 'Please enter the company name.',
fieldName: '<portlet:namespace />ExpandoAttributeName',
validatorName: 'required'
}
]
}
);
</aui:script>
Thanks and Regards,
Apoorva Prakash