Home arrow Design Usability arrow Page 4 - Using HTML_QuickForm To Manage Web Forms, Part 1

Using HTML_QuickForm To Manage Web Forms, Part 1

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.

Author Info:
By: Harish Kamath
Rating: 5 stars5 stars5 stars5 stars5 stars / 73
December 22, 2004
  1. · Using HTML_QuickForm To Manage Web Forms, Part 1
  2. · Installing The HTML_QuickForm Package
  3. · My First HTML_QuickForm
  4. · FORM Elements
  5. · Adding Standard HMTL FORM Elements
  6. · Defining FORM Controls, Submitting Data
  7. · Grouping
  8. · "Checkbox" and "Radio" Elements
  9. · Drop Down Control and Hidden Element
  10. · Implementing Form Validations
  11. · Password Field Validation
  12. · Processing Data With HTML_QuickForm
  13. · Conclusion

print this article

Using HTML_QuickForm To Manage Web Forms, Part 1 - FORM Elements
(Page 4 of 13 )

Now, I have to add different <FORM> elements to my "Registration" Web form.


// snip

$obj_registration_form->addElement('header', '', 'Registration');
$obj_registration_form->addElement('html', '<tr><td colspan="2">&nbsp;</td></tr>');
$obj_registration_form->addElement('header', '', 'Artist Information');
$obj_registration_form->addElement('html', '<tr><td colspan="2">&nbsp;</td></tr>');

// snip


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.

blog comments powered by Disqus

- Responsive Web Design: More Than Just a Buzz...
- Add New Website Features to Please Users
- Gzip Components in Action
- Configuring Gzip Components
- Gzip Components
- Create Great JavaScript and CSS Menus Simply
- Design Principles that Shape a Web Site
- Creating Aqua Style Images
- Easy as A,B,C dynamic A to Z indexes
- EasyChart: a Usability Teaching Tool to Demo...
- Building Friendly Pop-up Windows
- Back to School: Design Usability
- Using HTML_QuickForm To Manage Web Forms, Pa...
- Using HTML_QuickForm To Manage Web Forms, Pa...
- More Website Knick Knack

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials