Home arrow HTML arrow Page 8 - HTML Tutorial
HTML

HTML Tutorial


This article is the September contest winner. The author provides a basic tutorial of HTML, with code samples illustrating headings, lists, background colors, using the Frame tag and more.

Author Info:
By: Anand Narayanaswamy
Rating: 3 stars3 stars3 stars3 stars3 stars / 73
October 11, 2004
TABLE OF CONTENTS:
  1. · HTML Tutorial
  2. · Paragraph Tags, Attributes and Headings
  3. · Using Lists
  4. · Indents and Links
  5. · Working with Images
  6. · Working with Tables
  7. · Working with Frames
  8. · Using Forms, Text, Buttons, and Combo Box
  9. · Text Area, Check Box, and Radio Buttons
  10. · Additional Tags
  11. · Drawing Lines, SUB and SUP Tags
  12. · Test Yourself Questions

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
HTML Tutorial - Using Forms, Text, Buttons, and Combo Box
(Page 8 of 12 )

Forms are used widely on nearly all Web pages. Web sites collect feedback information, registration details through these forms. If you have ever signed up for free web pages, free email services from yahoo, hotmail etc you may be already aware and familiar with forms. They are applied using <FORM> </FORM> tag. This tag accepts one important attribute namely action, which is used to specify the path for the specified action. HTML forms mainly consist of various form elements, which are specified using <INPUT>tag. This tag accepts many attributes, which are elaborated below along with Form elements.

Text Field

This element is used to enter texts like usernames, addresses etc. Its main attributes are type (value = text), size (value = “Any numeric value”), Maxlength (Value = “Any numeric value”). In the code given below, a user can enter 30 characters initially and then the text scrolls to the left.

Listing 18

    <INPUT type = “text” size = “30”>

Buttons

One of the most important form elements is Button. They serve an integral part in an HTML form. They are mainly used to trigger actions. There are two types of buttons, which are Submit and Reset. Submit buttons delivers the entire data on the form to the server while Reset button clears all your previous entries. The important attributes are type (value = Submit or Reset), Value (value = “Any Text like OK, Cancel”). To create a button labeled Click here, you have to code like as shown below:

Listing 19

    <INPUT type = “submit” value = “Click here”>

Combo box

These boxes enable you to pick an item from a set of values. They are applied using <SELECT> tag as shown below:

Listing 20

<SELECT name = "s1">
<OPTION>India
<OPTION>USA
<OPTION>UK
</SELECT>

The above code creates a list of 3 countries. However, as said before users can select any one item at a time. You can change this behavior by applying an attribute named multiple as shown below:

Listing 21

<SELECT name = "s1" multiple>
<OPTION>India
<OPTION>USA
<OPTION>UK
</SELECT>


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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