This package can display and validate a form that uses HTML5.
It provides functions to add different types of form fields, buttons, or additional HTML tags.
Currently, it supports the field types: bic, checkbox, checkbox group, color, credit card, currency, date, email, file, float, hidden, IBAN, integer, IP, name, password, radio, radio group, range, select, tel, text, textarea, time, URL, zip code.
It also supports button types: submit, reset, and button.
HTML tags are of any type you need to insert into your form, for example, HTML code for a multi-column form or JavaScript to get the visitor's position coordinates.
The HTML generated by this package for the form uses JavaScript to validate the input on-the-fly but also works when the browser does not enable JavaScript support. In this case, the validation will happen only using the rules specified by the generated HTML tags.
The generated JavaScript code assigns the input fields validated by a CSS class that can be either wrong or correct. Developers can define these CSS classes in the stylesheet to show the validation state of each input to the site user.
After the form is submitted, the class can take the submitted form input values to validate the form on the server side. The class returns either 'true' for a completely valid form or an array with the names of the non-valid fields.