Forums

Home » Liferay Portal » English » x. Miscellaneous

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
chirag @ India
web form validation is not working ???
March 26, 2013 12:44 AM
Answer

chirag @ India

Rank: Regular Member

Posts: 129

Join Date: December 20, 2011

Recent Posts

I try to implement client side validation using java script ,but it is not validate form input data in web form portlet in liferay

what i do is :

First In Portlet-ext.porperties i write this line to enable java script and then restart server

validation.script.enabled true

After Web-form configuration i right simple script

== Mobile No ==

var alphaExp = /^[a-zA-Z]$/;
if(currentFieldValue.match(alphaExp)) {
return false;
}else {
return true;
}
== Email Id ==
if (currentFieldValue.indexOf("@")>=0)
return true;
else return false;

then publish,but this is can't validate from data and form successfully sended!!

help me out...
Muradali Hasan
RE: web form validation is not working ???
May 19, 2013 10:44 PM
Answer

Muradali Hasan

Rank: Junior Member

Posts: 82

Join Date: July 26, 2010

Recent Posts

Hi Chirag,

May be you are using form submit object which submit your form.

you can do one think change submit type to button and call java script function on onclick() after validating your data submit form through java script.

document.<formname>.submit();
Timo Kurowski
RE: web form validation is not working ???
June 27, 2013 6:12 AM
Answer

Timo Kurowski

Rank: Regular Member

Posts: 223

Join Date: June 24, 2013

Recent Posts

I have the exact same Problem. Cant change the Button tho, since its a downloaded portlet that sits on the server where i cant reach its code. (Translation is horrible, too).
Edwin Buising
RE: web form validation is not working ???
July 23, 2013 5:42 AM
Answer

Edwin Buising

Rank: New Member

Posts: 2

Join Date: February 5, 2013

Recent Posts

I have the same issue. Any developments?
Neetu Mishra
RE: web form validation is not working ???
August 23, 2013 7:25 AM
Answer

Neetu Mishra

Rank: Junior Member

Posts: 69

Join Date: May 21, 2012

Recent Posts

Hi All,

Please refer the below link:
http://www.liferay.com/community/forums/-/message_boards/message/15848474


Regards,
Neetu