[jala-dev] code contribution

  • From: "Maksim Lin for technical support mailling lists" <maksim_lin@xxxxxxxxxxxxxx>
  • To: <jala-dev@xxxxxxxxxxxxx>
  • Date: Fri, 16 Mar 2007 17:10:49 +1100

Hi everyone,

I have recently been working on a small bit of code to do server side
validation in helma. The code works by reading a properites file
(data.properties) located inside each prototype with syntax such as:

title.datatype = alpha
title.required = true
title.maxlength = 5

firstName.datatype = name
firstName.required = true
firstName.maxlength = 32

phone.datatype = phone-au
phone.required = true
phone.maxlength = 16

ageGroup.datatype = digit
ageGroup.required = false


The validation then can be done via a function:
HopObject.prototype.validate
I also have a utility function for splitting up fields in req.data "by
prefix" for forms with fields which correspond to 2 or more different
Prototypes.

So I wanted to ask if there would be any interest in including this code
as a new module within jala?
It would need a bit of cleanup to meet the high standards set by the
existing jala code, but I'd be happy to implement any feedback if that
was the case.

thanks,
Maks.

Other related posts: