Home arrow Graphic Design arrow Page 4 - Using HTML Quickform for Form Processing
GRAPHIC DESIGN

Using HTML Quickform for Form Processing


With HTML_QuickForm version 3.1, you can have a consistent look across all your forms and a simplified file upload. This chapter starts with the basics then shows you how to process submitted form data with HTML_QuickForm. (From the book, Essential PHP Tools: Modules, Extensions, and Accelerators, by David Sklar, Apress, 2004, ISBN: 159059280.)

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 193
September 01, 2004
TABLE OF CONTENTS:
  1. · Using HTML Quickform for Form Processing
  2. · Steps for the Example
  3. · Individual Elements
  4. · Text, Password, Textarea
  5. · Hidden, Select
  6. · Checkbox, Radio
  7. · Submit, Reset, Button, Image
  8. · File, advcheckbox, Static
  9. · Header, Link, HTML
  10. · Element Groups
  11. · Processing Submitted Data
  12. · Without a Callback Function
  13. · Setting Validation Rules

print this article
SEARCH DEVARTICLES

Using HTML Quickform for Form Processing - Text, Password, Textarea
(Page 4 of 13 )

The text element produces the single-line text-entry box displayed by the HTML tag <input type="text">.

These are the valid arguments when creating a text element:

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

  • $elementLabel: The label of the element in the form

  • $attributes: Arbitrary element attributes, as a string or an associative array These are its methods:

  • setSize(): The size attribute controls the width of the displayed text box.

  • setMaxlength(): The maxlength attribute tells the browser how many characters can be typed into the text box.

The following is a sample usage:

$form->addElement('text','first_name','First Name:','class="big"');

This is the sample HTML:

<tr>
<td align="right" valign="top"><b>First Name:</b></td>
<td valign="top" align="left"><input class="big" name="first_name" type="text"
/></td>
</tr>

password

The password element behaves just like the text element, but it is displayed with the <input type="password"> tag instead of <input type="text">. This means that text entered into a password box isnít displayed as itís entered. Instead, an asterisk or other symbol is shown in place of each character.

textarea

The textarea element produces the multiple-line text-entry area displayed by the HTML tags <textarea></textarea>.

These are the valid arguments when creating a textarea element:

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

  • $elementLabel: The label of the element in the form

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

The following are its methods:

  • setWrap(): The wrap attribute controls how lines are wrapped inside the textarea. soft means that the browser displays wrapped text but doesnít send the line breaks with submitted data, hard means that wrapped text is displayed and sent to the server, and off means the browser does no wrapping on its own.

  • setRows(): The rows attribute controls how many lines of text are visible in the textarea at one time.

  • setCols(): The cols attribute controls the width of the textarea.

The following is a sample usage:

$form->addElement('textarea','profile','Describe yourself:','wrap="soft"');

The following is the sample HTML:

<tr>

<td align="right" valign="top"><b>Describe yourself:</b></td>

<td valign="top" align="left"><textarea wrap="soft" name="profile">

</textarea></td>

</tr>

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.


blog comments powered by Disqus
GRAPHIC DESIGN ARTICLES

- Customizing Wordpress Favicons and Gravatars
- 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

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 
Support 

Developer Shed Affiliates

 




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