Tired of authoring dull and dreary Web forms everyday? Fed up of programming JavaScript validations day-in and day-out? Then, the HTML_QuickForm package is just the solution for which you are looking. In the first part of this two-part tutorial, I'll get you started with the basics of building Web forms using this resourceful PEAR package.
All HTML_QuickForm elements are broadly divided into two categories: standard HTML <FORM> elements and custom elements.
First, I have added two custom HTML_QuickForm elements using the addElement() method - the first custom type is the "header" element that allows us to display "header" text - text with a larger font size - in the Web form. Next, I included some raw HTML code using the "html" custom element - nothing much to talk about.
A little warning before I proceed - the official documentation does not recommend the use of this "html" element as it can soon lead to spaghetti-style HTML code in your PHP script. Instead, they recommend the use of templates to control the layout. You'll learn more about using templates in the second part of this tutorial.