HTML
  Home arrow HTML arrow Page 5 - 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  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
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? 
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 - Sending Data with a Form


    (Page 5 of 6 )

    We mentioned the Submit button above. In this section we are going to use it, along with the action attribute to send data to a web page that would usually have some code to do something with the information we collect. For more on how to work with information from HTML forms, you can read my series on ASP or PHP (shameless self plug).

    For now, here is how you create the form:

    <html>

    <body>

    <form name="wookie" action="sample.asp" method="get">

    Please Enter Your Name:

    <input type="text" name="name" value="Bruce Digelow" size="25">

    <br>Please Enter Your Occupation:

    <input type="text" name="occupation" value="Male Jiggler" size="25">

    <br>

    <input type="submit" value="Submit">

    </form>

    <p>

    When you click the Submit button, it sends the data to a page called, "sample.asp". At least, it would if you had such a page on your server.

    </p>

    </body>

    </html>

    This results in the following:


    Please Enter Your Name:
    Please Enter Your Occupation:

    When you click the Submit button, it sends the data to a page called "sample.asp." Well, it would if you had such a page on your server.

    When the user clicks the Submit button, it sends the information to the file listed in the action attribute (in this case sample.asp).

    Sending Data from Checkboxes

    You can of course also send the results of checkboxes to a page. Here is how:


    <html>

    <body>

    <p>Things that describe me:

    <form name="input" action="sample.asp" method="get">

    I am fat:

    <input type="checkbox" name="descrip" value="fat" checked="checked" />

    <br />

    I wear glasses:

    <input type="checkbox" name="descrip" value="fat" />

    <br />

    I have a sloppy haircut:

    <input type="checkbox" name="descrip" value="fat" />

    <br /><br />

    <input type="submit" value="Submit" />

    </form>

    </body>

    </html>

    The result:


    Things that describe me:

    I am fat:
    I wear glasses:
    I have a sloppy haircut:

    And of course this works with the other input types as well, such as the radio button:


    <html>

    <body>

    <form name="input" action="sample.asp" method="get">

    Yes:

    <input type="radio" name="maybe" value="Yes" checked="checked">

    <br>

    No:

    <input type="radio" name="maybe" value="No">

    <br><br>

    <input type ="submit" value ="Submit">

    </form>

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

    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset
    - Building Single Row Database Forms with HTML
    - Introduction to Database Forms with HTML
    - Another Look at Animation of Geographical Ma...
    - Animation of Geographical Map Regions
    - Changing and Moving Pictures with CSS
    - Clickable Geographical Map Regions
    - Gradient Creation with the HR Element
    - Text on HTML Images: Do it Yourself







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