Design Usability
  Home arrow Design Usability arrow Page 8 - 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  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
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 / 49
    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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Using HTML_QuickForm To Manage Web Forms, Part 1 - "Checkbox" and "Radio" Elements


    (Page 8 of 13 )

    Next, let me bring your attention to the other groupings that I have implemented in the example:

    <?php

    // snip

    // create a checkbox group
    $obj_genre[] = &HTML_QuickForm::createElement('checkbox', 'Alternative', null, 'Alternative');
    $obj_genre[] = &HTML_QuickForm::createElement('checkbox', 'Hip-Hop', null, 'Hip-Hop');
    $obj_genre[] = &HTML_QuickForm::createElement('checkbox', 'Other', null, 'Other');
    $obj_registration_form->addGroup($obj_genre, 'chkGenre', 'Group Genre:', '<br />');

    // create a radio button group
    $obj_type[] = &HTML_QuickForm::createElement('radio', NULL, NULL, 'Male Solo', 'Male_Solo');
    $obj_type[] = &HTML_QuickForm::createElement('radio', NULL, NULL, 'Female Solo', 'Female_Solo');
    $obj_registration_form->addGroup($obj_type, 'radGroupType', 'Group Type:');

    // create a multiple select drop down
    $obj_registration_form->addElement('select', 'ddlLookingFor', 'Looking For:', array ("Publishing_Deal" => "Publishing Deal", "Label_Deal" => "Label Deal","Management_Deal" => "Management Deal", "Other" => "Other"), array("size" => "3", "multiple"));

    // snip

    ?>

    Here I have created a group of "checkbox" and "radio" <INPUT> elements using the createElement() static method. In this case, I have assigned the resultant element objects to an array. Next, I have passed this array of objects directly as input to the addGroup() method to render them in the browser. Note the use of a line break as a separator for the "checkbox" element - this displays each checkbox button on new line in the output.

    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...
     

    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-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway