留言板

web form validation is not working ???

thumbnail
chirag dashalaniya,修改在11 年前。

web form validation is not working ???

Regular Member 帖子: 129 加入日期: 11-12-21 最近的帖子
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...
thumbnail
Muradali Hasan,修改在10 年前。

RE: web form validation is not working ???

Junior Member 帖子: 84 加入日期: 10-7-27 最近的帖子
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,修改在10 年前。

RE: web form validation is not working ???

Regular Member 帖子: 240 加入日期: 13-6-24 最近的帖子
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,修改在10 年前。

RE: web form validation is not working ???

New Member 帖子: 2 加入日期: 13-2-5 最近的帖子
I have the same issue. Any developments?
thumbnail
Neetu Mishra,修改在10 年前。

RE: web form validation is not working ???

Junior Member 帖子: 75 加入日期: 12-5-21 最近的帖子
Hi All,

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


Regards,
Neetu