elfuchsjekyll / vosao

Automatically exported from code.google.com/p/vosao
0 stars 0 forks source link

Form field validation #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When adding form fields it is possible to set if field is mandatory and 
default value.
It would be useful to add also field for regex pattern for validation of the 
field. (At least client validation).
And maybe most common validation patterns predefined such as email address.

Moreover why not introduce new html 5 field types such as email, url, tel, 
number, time, datetime. This will not break anything since if browser do not 
support it these are threated as text. But it is nice in new browsers.

Original issue reported on code.google.com by adis.kat...@gmail.com on 12 Feb 2010 at 12:34

GoogleCodeExporter commented 9 years ago
Use jQuery.validation plugin.

Original comment by kinyelo@gmail.com on 19 Feb 2010 at 3:28

GoogleCodeExporter commented 9 years ago
After close look at jQuery.validation it offers few predefined validation 
classes. So 
integration in vosao will not bring much new validation functionality.

At last I decided to add validation regex with localized messages.

Original comment by kinyelo@gmail.com on 2 Mar 2010 at 3:05

GoogleCodeExporter commented 9 years ago
Implemented.

Original comment by kinyelo@gmail.com on 3 Mar 2010 at 8:28

GoogleCodeExporter commented 9 years ago
How is this used? How do I add validation on two fields, 
name - mandatory field
email - mandatory field and must be valid email address

Original comment by adis.kat...@gmail.com on 25 Mar 2010 at 8:38

GoogleCodeExporter commented 9 years ago
1. Create name field with "Mandatory" checkbox on
2. Create email field with "Mandatory" checkbox on and
   - "Regex validation code" set: 
      ^[a-zA-Z0-9._+&*# -]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$
   - "Regex error message" set: 
      Provide valid email

Original comment by kinyelo@gmail.com on 25 Mar 2010 at 10:19