SiteExperts.com Logo Home | Community | Developer's Paradise | Jobs
User Groups | Site Tools | Site Information | Search
 Main Menu
 HTML Online

HTML Tables

Form Elements
  Input Elements
  Select Elements
  TextArea Element
  Button Element
  Grouping and Labeling
  Form Element

Images and Objects

 


Sponsored Links

HTML Form Element

The HTML Form Element is used to group related fields together and to optionally submit the results back to the server. While the FORM element is useful for grouping elements, form elements be placed outside of a form. When input controls are not used within a FORM element, or the values are not being submitted back to the server, client-side script will usually be written to process the input. For example, in all the interactive tutorials through this tour and most of this web-site use script to manipulate the user's input.

While HTML 4.0 does not require the FORM element to use the input controls, this does not work in Netscape Navigator. Netscape requires all input controls to be placed inside a FORM block. Therefore, when authoring pages to target cross-browser, you should always wrap input elements in a FORM even if the form is not being submitted to the server. For example:

  <FORM>
    <INPUT TYPE=text NAME=tb>
  </FORM>

To submit a form's input back to the server, you need to supply an ACTION

Submitting Input to the Server

A number of rules are used to determine what input controls and values are submitted to the server. The rules are as follows:

  • Disabled controls are not submitted.
  • If the submit button pressed has a name and value, the name value pair is submitted.
  • All checked checkboxes are submitted.
  • For radio button groups, only the selected radio button's name and value are submitted.
  • All selected options and their values are submitted.
  • The current value of the file upload control. Following the submission of the form all the contents of the specified files are submitted.
  • Any OBJECT elements that have a name specified.

For more information on form submission, see the HTML 4.0 recommendation.

This brings us to the conclusion of the built-in HTML input elements. At the next stop we discuss the IMG and OBJECT elements. The OBJECT element is a generic element that allows you to embed custom objects on your page. If the OBJECT is a custom input element, it can participate in a FORM's submission if it is given a name and it exposes a value to submit. Most uses of object will revolve around embedded custom components on your web page.

Images and Objects...

Copyright © 1997-2008 InsideDHTML.com, LLC. All rights reserved.