Advanced form validation with scripting technologies

One of the goals of Romulus (http://www.ict-romulus.eu) is to improve productivity of developers by allowing the use of scripting languages to develop certain task.

A point where scripting technologies can be very valuable is when performing form validation. The most common case is to allow the definition of regular expressions the field must match. While this is a good approach, it has limitations. How can you validate a name? How can you validate an address? How can you validate a given field is different from another? This kind of validations can not be done using regular expressions, and require Java coding in classes to be performed, thus it is not possible (or at least quite difficult) to user configurable validation of forms.

The idea is to use scripting technologies to allow the definition of the validation function when defining a form using Webform portlet. The chosen scripting language could be anyone of the currently supported by Liferay (PHP, Ruby, Groovy, Python and Javascript), but using Javascript has an additional benefit. With the appropiated transformation it could be possible to execute validation also in the client side (much like struts forms does).

Let's work on it!

 

2
Blogs
Hi,

It's now implemented. You can define your own custom validation functions for web form. Try it!