Design Usability
  Home arrow Design Usability arrow Page 3 - Using HTML_QuickForm To Manage Web Forms, ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DESIGN USABILITY

Using HTML_QuickForm To Manage Web Forms, Part 1
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 55
    2004-12-22

    Table of Contents:
  • Using HTML_QuickForm To Manage Web Forms, Part 1
  • Installing The HTML_QuickForm Package
  • My First HTML_QuickForm
  • FORM Elements
  • Adding Standard HMTL FORM Elements
  • Defining FORM Controls, Submitting Data
  • Grouping
  • "Checkbox" and "Radio" Elements
  • Drop Down Control and Hidden Element
  • Implementing Form Validations
  • Password Field Validation
  • Processing Data With HTML_QuickForm
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using HTML_QuickForm To Manage Web Forms, Part 1 - My First HTML_QuickForm


    (Page 3 of 13 )

    As you might have guessed, the aim of this article is to demonstrate the ease with which one can generate a Web form using the HTML_QuickForm package. Click on the link below to view the code listing for my first Web form:

    Code Listing 1

    Load this example in the browser to view the following output:

    Using_HTML_QuickForm

    A quick review of the code and you will see that I have not hard-coded any <FORM> elements - yet, the browser displays a neat little Web form when the script is loaded. At this point, I can safely conclude that this package definitely fulfills one of my original goals: I should not be required to type any HTML code during development.

    Now it's time to dissect the code listing. For starters, I have to "require" PHP file that contains the definition of the HTML_QuickForm() class as shown below:

    <?php

    // include the required PEAR class
    require_once 'HTML/QuickForm.php';

    // define a new HTML_QuickForm object
    $obj_registration_form = new HTML_QuickForm('frmRegistration');

    // snip

    ?>
     

    Moving to the next statement - I have created a new instance (called "$obj_registration_form") of the HTML_QuickForm() class. The constructor of this class has one compulsory parameter - the name of the Web form. The rest of the input parameters are optional; among other things, these optional parameters allow me to specify values for the different attributes associated with the <FORM> HTML element.

    Note that the default value of the "method" attribute is "POST" the above Web form. So, if I wish to use the "GET" method, I need to pass this value explicitly to the constructor.

    More Design Usability Articles
    More By Harish Kamath


       · When first time i saw this article i thought that it will solve all my problems that...
       · Then install the pear common package.
       · Great article! Where and how does the $ary_artist_info array get created in this...
     

    DESIGN USABILITY ARTICLES

    - 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
    - Browsers as Test Platforms
    - Website Knick Knack
    - Dynamic Page Elements-Cloak and Dagger Web D...
    - Accessibility and Dreamweaver MX 2004







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek