Tuesday, February 19, 2013

Jformer - Created new validation type - alphaWords = alphaDecimal + spaces

jFormer is a form framework written on top of jQuery that allows you to quickly generate beautiful, standards compliant forms. Leveraging the latest techniques in web design, jFormer helps you create web forms that:
  • Validate client-side
  • Validate server-side
  • Process without changing pages (using AJAX)
But it does lack a basic validation type that would expect from such a library, a validation type that could allow for spaces. I took the alphaDecimal base type and added spaces. 

That is exactly what I created, I called it using Jformer parlance alphaWords. 

alphaWords - Accepts only letter, numbers and spaces

Positive Validation Example : John Doe
Also extended the base type to handle periods and dashes and called it  

alphaFirstNameRestricted - Accepts only letter, numbers, periods, spaces and dashes.

Positive Validation Example : John-Doe Jr.

No comments:

Post a Comment