简体   繁体   中英

About javascript validation in liferay webform

I use liferay 6.1 ga1. In my webform I want to validate input email so I tried:

if(typeof currentFieldValue.match('^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})')[0] !== 'undefined'){return true;}else{return false};

It does not work, but it not my trouble, it return javascript error and I can not change my javascript validate code-> big trouble here To fix javascript validate code, I must to:

- Stop server
- Change validation.script.enabled to false 
- Start server
- Change javascript validate code
- Stop server
- Change validation.script.enabled to true
- Start server
- Check and Hope my code will work ( but it usually will not ) 

:(( Is there any faster and better way, please show me

Two Things here.

  1. Please post your javascript error and try to find out why it is coming?

  2. If it is too much of a troublesome process, you can simply delete the portlet and add a new one again and try fixing it.

All the webform settings and configurations are stored as portlet preferences. Portlet preferences are temporarily stored in database, if you delete the portlet from the page, preferences will removed along with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM