This class can validate forms with rules defined in form template.
It takes as parameter HTML template that defines the layout of a form with inputs.
The class can validate the submitted form values using rules defined in HTML attributes of the input tags in the the form HTML template.
It supports rules defined in HTML 5 specification as well other custom types of validation rules like required, week, month, color, creditcard, url, integer, number, range, email, alphabetic, alphanumeric, time, datetime, datetime-local, date, captcha, zipcode, countryelement, maxlength, minlength, min, max, mustmatch, enum and callback.
The class can also parse the template to remove the validation attributes that are not valid in HTML 4 or HTML 5, and then it replaces the input values attributes with the form submitted values.
Prize: One downloadable copy of Komodo IDE
|Most Web pages with forms have inputs that need to satisfy certain rules that need to be validated.
Usually the form presentation output is defined separately from the rules that need to be validated.
This class provides an alternative approach that allows to define the form output template and the validation rules in the same place.