Message Boards

Validate Custom Attribute

Jagir Vimalbhai Buch, modified 9 Years ago.

Validate Custom Attribute

New Member Posts: 11 Join Date: 3/28/14 Recent Posts
Hi All,

I want to validate custom attribute taken in Registration form
is it possible?
thumbnail
Jeffrey Handa, modified 9 Years ago.

RE: Validate Custom Attribute

Liferay Master Posts: 541 Join Date: 12/1/08 Recent Posts
Hi Jagir,

Are you using <liferay-ui:custom-attribute> tag on your registration form? To perform validation on the UI I think you'd have to replace the tag with your own code. If you're using your own front end code you might need to do a little work to ensure your form data gets processed correctly on the backend.

To perform validation on the back end you could use a Service Wrapper that wraps the addValue method in the ExpandoValueLocalService.
Jagir Vimalbhai Buch, modified 9 Years ago.

RE: Validate Custom Attribute

New Member Posts: 11 Join Date: 3/28/14 Recent Posts
Yes sir , I am using <liferay-ui:custom-attribute> tag in "create_account.jsp" page.
By using hook i am trying to modify create_account.jsp page.
In this page i had added one custom field but now i want to validate that field like , only numeric value can be entered

How can i do this in hook?

Thank you sir
thumbnail
Achmed Tyrannus Albab, modified 8 Years ago.

RE: Validate Custom Attribute

Regular Member Posts: 158 Join Date: 3/5/10 Recent Posts
Jagir Buch:
Yes sir , I am using <liferay-ui:custom-attribute> tag in "create_account.jsp" page.
By using hook i am trying to modify create_account.jsp page.
In this page i had added one custom field but now i want to validate that field like , only numeric value can be entered

How can i do this in hook?

Thank you sir


Did you manage it mate? If so please do share.
thumbnail
Julien Mourad, modified 8 Years ago.

RE: Validate Custom Attribute

Junior Member Posts: 78 Join Date: 1/22/15 Recent Posts
You're probably gonna have to end up using alloy ui form validator. (replace YUI with AUI in your code)
thumbnail
Achmed Tyrannus Albab, modified 8 Years ago.

RE: Validate Custom Attribute

Regular Member Posts: 158 Join Date: 3/5/10 Recent Posts
Julien Mourad:
You're probably gonna have to end up using alloy ui form validator. (replace YUI with AUI in your code)


Thanks for that bro. I actually manage to use the ALLOYUI. But the issue i'm having is, with ALLOYUI the error message is on the top.
Whereas the standard error messages will be just beside the input fields. So how do i standardize this? What is the standard in doing this?
thumbnail
Nikhil Nishchal, modified 8 Years ago.

RE: Validate Custom Attribute

Regular Member Posts: 177 Join Date: 6/22/12 Recent Posts
You may create your own form validatior rule for this form and use them in hook of create_user jsp.

http://alloyui.com/tutorials/form-validator/