![]() | ![]() |
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![]() ![]() ![]() ![]() |
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![]() ![]() |
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 | ||||||||||
ID![]() |
Generic description of the ID attribute | ||||||||||
METHOD![]() ![]() ![]() ![]() |
This attribute determines which HTTP method will be used to pass the data to
the program.
The default method is GET. | ||||||||||
NAME![]() ![]() ![]() |
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![]() |
JavaScript code to execute when the user presses a button with TYPE=RESET. | ||||||||||
ONSUBMIT![]() ![]() |
JavaScript code to execute when the user presses a button with TYPE=SUBMIT. | ||||||||||
TARGET![]() ![]() |
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
|
![]() | ![]() |
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: | |
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: | |
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 : |