HTML_QuickForm Tutorial
In this tutorial I intend to cover some of the basic features of HTML_QuickForm, along with lots of examples to help you get to grips with how you can use it to simplify and speed up development of your forms.
A hello world example
We’ll start with a little form to ask for a users name, and then on submit, we’ll say hello! I’ll implemnt this in 2 ways. The first method is how HTML_QF is used in all the examples in the various documentation/examples I have seen, the second method is how I personally prefer to use it.
Method 1
Method 2
In all other examples on this tutorial, I will stick to this second method of using HTML_QuickForm, as this is my prefered method. Due to my laziness, only the second code example here has full comments explaining how this is working
A Signup Form
A full-featured example
This example is taken from the documentation, and shows off a lot of what HTML_QF is able to achive.
A form proprocessor
Using a form rule to do some pre-processing of the form... ish. This can be used to check server loads, or anything like that. This example will fail to process the form 50% of the time. Not so useful.
A form that builds itself
Have a look at this page.
Using QuickForm renderers
I have constructed a demo page to show the output of a few of the array based HTML_QF renderers. Working example Other Resources The package homepage