Graphic Design
  Home arrow Graphic Design arrow Page 7 - Using HTML Quickform for Form Processing
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? 
GRAPHIC DESIGN

Using HTML Quickform for Form Processing
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 147
    2004-09-01

    Table of Contents:
  • Using HTML Quickform for Form Processing
  • Steps for the Example
  • Individual Elements
  • Text, Password, Textarea
  • Hidden, Select
  • Checkbox, Radio
  • Submit, Reset, Button, Image
  • File, advcheckbox, Static
  • Header, Link, HTML
  • Element Groups
  • Processing Submitted Data
  • Without a Callback Function
  • Setting Validation Rules

  • 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

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Using HTML Quickform for Form Processing - Submit, Reset, Button, Image


    (Page 7 of 13 )

    The submit element produces an HTML <input type="submit"> tag. This is typically displayed by the browser as a button that, when clicked, submits the form to the server.

    These are the valid arguments when creating a submit element:

    • $elementName: This is the name attribute of the element’s <input> tag.

    • $value: The value attribute of the element’s <input> tag. This is displayed on the button.

    • $attributes: Arbitrary element attributes, as a string or an associative array

    The following is a sample usage:

    $form->addElement('submit','save','Save Data');

    The following is the sample HTML:

    <tr>

      <td align="right" valign="top"<<b></b></td>

      <td valign="top" align="left"<<input name="save" value="Save Data"

      type="submit" /></td>

    </tr>

    reset

    The reset element produces an HTML <input type="reset"> tag. This element is identical to the submit element except that the reset button resets all elements in the form to their default values instead of submitting the form.

    button

    The button element produces an HTML <input type="button"> tag. This element is identical to the submit element except that the button has no default action associated with it. Typically, an action is linked to a button element by setting its onClick attribute to JavaScript that runs when the button is clicked.

    The following is the sample usage:

    $form->addElement('button','check','Check the Page','onClick="checkPage();"');

    The following is the sample HTML:

    <tr>

    <td align="right" valign="top"<<b></b></td>

    <td valign="top" align="left"<<input onclick="checkPage();" name="check" value="Check the Page" type="button" /></td>

    </tr>

    image

    The image element produces an HTML <input type="image"> tag. This displays an image in the form. A user can click the image to submit the form. The x and y coordinates of the pixel the user clicked in the image are submitted with the form as well.

    These are the valid arguments when creating an image element:

    • $elementName: The name attribute of the element’s <input> tag.

    • $src: The src attribute is a relative or absolute URL of the image to display.

    • $attributes: Arbitrary element attributes, as a string or an associative array

    The following is the sample usage:

    $form->addElement('image','state_map','/usa-states.png');

    The following is the sample HTML:

    <tr>

    <td align="right" valign="top"<<b></b></td>

    <td valign="top" align="left"<<input name="state_map" type="image"

    src="/usa-states.png" /></td>

    </tr>

    If a user submits the form by clicking in the upper-leftmost corner of the image, the submitted form variables state_map_x and state_map_y are both set to 0. A click ten pixels to the right and eight pixels down sets state_map_x to 10 and state_map_y to 8. Because the name attribute of the <input type="image"> tag is state_map, the submitted form variable state_map_x is set to the horizontal position in the image of the user’s click. Similarly, the submitted form variable state_map_y is set to the vertical position in the image of the user’s click.

    The same rules apply for URLs in the src attribute of <input type="image"> tags as they do in the src attribute of an <img< tag. If you specify a full URL, beginning with http://, the browser fetches the image from that location. If you just specify a pathname, the browser looks for the image relative to the URL of the page in which the form appears.

    This chapter is from Essential PHP Tools: Modules, Extensions, and Accelerators, by David Sklar, (Apress, 2004, ISBN: 1590592808). Check it out at your favorite bookstore today.

    Buy this book now.

    More Graphic Design Articles
    More By Apress Publishing


       · Any idea what version this comes in for the PEAR distribution?
       · If you follow the example code for uploading a file you may get frustrated that the...
       · Sorry,but I'd rather work in the old fashion way. You have much more control...
       · I think page 13 of the article, "Using HTML Quickform for Form Processing - Setting...
       · it's a really good tutorial. thank you again
       · Good intro, but you don't seem to have anything about setting default values, which...
       · Of course there is a method to set default values:e.g....
       · can you give me an example re: the client-side validation on custom rule.. the...
     

    GRAPHIC DESIGN ARTICLES

    - Building Corner Effects with Transparent Bac...
    - 3D Graphics Technology: VRML Part I - Introd...
    - Creating Visual Effects
    - Web Page Design Overview
    - Creating Artistic Photographs
    - Working with Tools in Paint Shop Pro 8
    - Using HTML Quickform for Form Processing
    - Introduction to Adobe FrameMaker
    - WebLogic Workshop, WebLogic Platform, and th...
    - Planning the Site
    - Working with Web Services
    - WebLogic Workshop Application Development Ba...
    - Scanning Images for Web Use
    - Web Graphics Overview
    - The Pen is Mightier than the Brush Tool






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway