Form Processing using patForms

Wombat uses patForms for generating HTML forms, validating user input and for general form processing-

As Wombat in compination with patForms does nearly everything for automatically, one just have to define form's input fields and do whatever you want to do with valid user input (e.g. publish blog entry).

Form Definition

Number Age How old are you field numeric 18 100 String Email Your email address field 5 255 Email String Captcha Captcha field captcha 3 255 Captcha
Example Form definition

Usually form input fields are defined and configured using XML files somewhere in your config folder. As the example shows, you can define any type of patForms-Element. Besides element's attributes simple rules like Captcha or Email may be defined here as well.

patForms includes a large variaty of elements. There are simple elements like String wich coresponds a simple input field with type set to text to Date, File and Radio- and SwitchGroup (see patForms Examples). Of course, there are some special Wombat form elements like Vfsfile (upload file directly to wombat's virtual file system) or the rich text editor Xinha.

Form Rules

Input validation is done by patForms as well. POST and GET-parameter are validated by patForms' elements and rules. Rules are very simple to use and implement, still they add create value to generic form elements. E.g. the rule Captcha in combination with an image tag creates a simple Touring-Test challenge. Or validate input Strings with rule Email to be a valid email address.

Helper

The Captcha helper class create and outputs challanges.

/WB/Captcha
Captcha: captcha challenge image