3.2 NS IE TV

<FORM>...</FORM>

Create a form inside a document. A form consists of one or more input-capable fields. The form can include GUI-elements such as radio-buttons, checkboxes, buttons and textfields.

Using a form you can send information to the Web-server which will invoke the supplied program and pass the information to that program. So with forms you can allow the user to pass data to the server. Forms can be used for things such as order-entry, supplying search criteria or subscribing to a mailing list.

The fields of a form are defined using the INPUT, SELECT and TEXTAREA tags.

ACTION
3.2 NS IE TV
This specifies an URL which will process the supplied data. You can use either email, or invoke a server-side forms handler via HTTP.
Note that using a mailto: URL is not supported by Microsoft's Internet Explorer.

ENCTYPE
3.2 NS
Specifies the mechanism used to encode the form's contents that will be sent to the server. The default is application/x-www-form-urlencoded.

Netscape introduced the type multipart/form-data which is used to implement <INPUT TYPE=FILE>.


ID
TV
Generic description of the ID attribute

METHOD
3.2 NS IE TV
This attribute determines which HTTP method will be used to pass the data to the program.

Value Description
GET The data is appended to the URL of the program.

The result is that the data is not passed directly to the program but made available in an environment variable called QUERY_STRING.

POST

The default method is GET.


NAME
NS IE TV
Give the form a name so it can be referenced in a scripting language.

For the webtv browser this attribute and the ID attribute are equal.


ONRESET
NS
JavaScript code to execute when the user presses a button with TYPE=RESET.

ONSUBMIT
NS IE
JavaScript code to execute when the user presses a button with TYPE=SUBMIT.

TARGET
NS IE
The TARGET attribute forces the load of that link into the targeted window. The value supplied with the attribute must be the same as the name of the window, and is case-sensitive. You can give a window a name with the FRAME tag. If a window with the supplied target name does not exists then a new window will be created with that name.
If you do not specify a target window the current window will be used, or the target specified with the BASE tag.

Magic TARGET names
These names all begin with the underscore character. Any targeted window name beginning with underscore which is not one of these names, will be ignored.

Value Description
_blank This target will cause the link to always be loaded in a new blank window. This window is not named.
_self This target causes the link to always load in the same window the anchor was clicked in. This is useful for overriding a globally assigned BASE target.
_parent This target makes the link load in the immediate FRAMESET parent of this document. This defaults to acting like _self if the document has no parent.
_top This target makes the link load in the full body of the window. This defaults to acting like _self if the document is already at the top. It is useful for breaking out of an arbitrarily deep FRAME nesting.

 
Source:
<FORM METHOD=POST ACTION=_URL_ ONRESET="alert('The form is reset')">
<TABLE>
 <TR><TD>Name  </TD><TD><INPUT TYPE=text NAME=name></TD></TR>
 <TR><TD>E-mail</TD><TD><INPUT TYPE=text NAME=email></TD></TR>
 <TR><TD COLSPAN=2>How did you find these pages
  <SELECT NAME=findout>
   <OPTION>Newsgroup
   <OPTION>Link on another page
   <OPTION>Search engine
  </SELECT></TD></TR>
 <TR><TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE=SUBMIT VALUE="Send values">
  <INPUT TYPE=RESET VALUE="Reset form"></TD>
 </TR>
</TABLE>
</FORM>
 
Result:
Name
E-mail
How did you find these pages

 
Source:
<FORM ENCTYPE=multipart/form-data ONSUBMIT="alert('Submitting the form')">
Send this file: <INPUT NAME=userfile TYPE=file>
<INPUT TYPE=SUBMIT VALUE="Send File">
</FORM>
 
Result:
Send this file:

 
Source:
Please put me on you cristmas-card list :
<FORM action=mailto:schluter@knoware.nl>
Name <INPUT NAME=Name>, Email addres <INPUT NAME=Email>
<INPUT TYPE=SUBMIT>
</FORM>
 
Result: Please put me on you cristmas-card list :
Name , Email addres


Statistics Copyright © 1996, 1997 Rob Schlüter
Last updated 1997/08/21
Email: schluter@knoware.nl