Tuesday, September 7, 2010

simple javascript validation pattern


I have designed a validation frame work for my web, i am posting the design example.

Concept: I will have an attribute called 'fieldType' on each input element which needs validation, also i will set the validate function on the onblur attribute of that input element.

Intent: To have uniform validation across all the pages input fields, each validation method is classified by it's field type and each one will have a RegEx patterns inside to test the value is proper or not.











No comments:

Post a Comment