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

    - 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
    For more Enterprise Application Development news, visit eWeek