HTML
  Home arrow HTML arrow Page 5 - HTML Tips
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 Tips
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2008-03-26

    Table of Contents:
  • HTML Tips
  • Text
  • Lists
  • Forms
  • Form Elements for Uploading Files

  • 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 Tips - Form Elements for Uploading Files


    (Page 5 of 5 )

    Use the POST method in your form start tag if you want to upload files. The GET method is not used for uploading files. Use the attribute, enctype, with the value of "multipart/form-data". The value for the enctype attribute is called the Content Type. The element that will hold the file name is the Input element whose type is set to "file". So as a minimum, you should have the following:


    <form action="http://server.com/cgi/handle" enctype="multipart/form-data" method="post">

    <input type="file" name="files">

    </form>


    The action attribute gives the destination (form processing agent) of the form. The element <input type="file" name="files"> will produce a text box and the browse button on the web page for locating the file.

    Grouping Names in the Select Element

    The following image shows some countries in different continents in a Select element:



    It is possible to group names inside a Select element as shown in the above diagram. You use the OPTGROUP to do this. The OPTGROUP element takes OPTION elements as its content. The following code was used to create the above Select element:


    <LABEL for="Countries">Countries</LABEL>

    <SELECT name="Countries" id="Countries">

    <OPTION selected value="none">--- Select ---</OPTION>

    <OPTGROUP label="Europe">

    <OPTION value="Britain">Britain</OPTION>

    <OPTION value="France">France</OPTION>

    <OPTION value="Germany">Germany</OPTION>

    </OPTGROUP>

    <OPTGROUP label="South America">

    <OPTION value="Argentina">Argentina</OPTION>

    <OPTION value="Brazil">Brazil</OPTION>

    <OPTION value="Peru">Peru</OPTION>

    </OPTGROUP>

    <OPTGROUP label="North America">

    <OPTION value="U.S.A">U.S.A</OPTION>

    <OPTION value="Canada">Canada</OPTION>

    </OPTGROUP>

    </SELECT>


    Note: browsers may interpret the OPTGROUP element slightly different in each case.

    These are tips I have gathered based on my experience and the experience of expert programmers. I have not addressed the problem of presentation (fonts, colors, margins, etc.) and making a web page interactive. These should be addressed under Cascading Style Sheets and Scripts (JavaScript) respectively.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · If you are coding in HTML and you reach a point where you do not know how to...
     

    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 3 hosted by Hostway