HTML
  Home arrow HTML arrow Page 3 - HTML 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? 
HTML

HTML Forms
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2008-02-06

    Table of Contents:
  • HTML Forms
  • Other Input Types
  • Checkboxes
  • Buttons
  • Sending Data with a Form
  • Sending E-Mail Via Forms

  • 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


    HTML Forms - Checkboxes


    (Page 3 of 6 )

    Checkboxes allow the user to select one or more values (or none really). Here they are in code:


    <html>

    <body>

    <form action="">

    <p> Are you a nerd? Check all that apply</p>

    I wear glasses:

    <input type="checkbox" name="nerd" value="Glasses" />

    <br />

    I have been know to wear suspenders:

    <input type="checkbox" name="nerd" value="Suspenders" />

    <br />

    I do have a pocket protector in my possession:

    <input type="checkbox" name="nerd" value="Pocket Protectors" />

    </form>

    </body>

    </html>

    The result:

    Are you a nerd? Check all that apply

    I wear glasses:
    I have been known to wear suspenders:
    I do have a pocket protector in my possession:

    Again you will note that each checkbox has the same name ("nerd"). If they do not, your program will not see them as part of the same set and the results of your form will be skewed.

    Drop-Down Boxes

    Drop-down boxes allow a user to select from a list of values. Here it is in code:


    html>

    <body>


    <form action="">

    <select name="Corny Villain Names">

    <option value="Dr. Doom">Dr.Doom</option>

    <option value="Dr. Octopus">Dr. Octopus</option>

    <option value="Chiropractor Payne" selected="selected">Chiropractor Payne</option>

    <option value="Nurse Nukem">Nurse Nukem</option>

    </select>

    </form>


    </body>

    </html>

    The above code creates a drop down list of items. You set the values in the list with the <option value> tag. You will also note the selected attribute, which sets the default item in the list. The following is the result of the above code:


    Textarea

    Users can enter multiple lines of text in a textarea field. In fact, they can enter an unlimited amount of text in the textarea. Here is how you code it:


    <html>

    <body>


    <textarea rows="10" cols="30">

    This is some text I am writing as an example. Normally the user writes in here. Once a certain amount of space is taken up, scroll bars will appear on the side of the textarea, allowing the user to scroll up and down.

    </textarea>


    </body>

    </html>

    More HTML Articles
    More By James Payne


       · Thanks for dropping by for my article on HTML Forms. In this one we talk about how...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT