1 | <HTML>
|
---|
2 | <!-- This file is part of the HTML Reference Library ('HTMLib') -->
|
---|
3 | <!-- It should not be used outside of the HTMLib package -->
|
---|
4 | <!-- The HTMLib is © 1995-1998 Stephen Le Hunte -->
|
---|
5 | <!-- htmlib@htmlib.demon.co.uk -->
|
---|
6 | <HEAD>
|
---|
7 | <LINK REL="stylesheet" HREF="../style.css" TYPE="text/css">
|
---|
8 | <TITLE><FORM></TITLE>
|
---|
9 | </HEAD>
|
---|
10 | <BODY TOPMARGIN="0" BGCOLOR="#FFFFE0" TEXT="#000000">
|
---|
11 |
|
---|
12 | <CENTER>
|
---|
13 | <SPAN CLASS="NSRtitle"><FORM...></SPAN>
|
---|
14 | </CENTER>
|
---|
15 |
|
---|
16 |
|
---|
17 | <P>The Form element is used to delimit a data input form. There can be several forms in a single document, but the Form element can not be nested. (I.e. a form can't contain another form)
|
---|
18 |
|
---|
19 | <SPAN CLASS="egcode">
|
---|
20 | <BLOCKQUOTE>
|
---|
21 | <CODE><STRONG><FORM</STRONG> ACTION="_URL_" METHOD="GET|POST" ENCTYPE="MIME type"><BR>
|
---|
22 | . . .<BR>
|
---|
23 | <STRONG></FORM></STRONG>
|
---|
24 | </CODE>
|
---|
25 | </BLOCKQUOTE>
|
---|
26 | </SPAN>
|
---|
27 |
|
---|
28 | <P>The <A NAME="ACTION"><SPAN CLASS="attr">ACTION</SPAN></A> attribute is a URL specifying the location to which the contents of the form data fields are submitted to elicit a response. As mentioned before, this could be simply a direction to an e-mail address, but generally, would be used to point towards some kind of server based CGI script/application that handles the forwarding of form data. If the <CODE>ACTION</CODE> attribute is missing, the URL of the document itself is assumed. The way data is submitted varies with the access protocol of the URL to which the form data is sent and with the values of the <SPAN CLASS="attr">METHOD</SPAN> and <SPAN CLASS="attr">ENCTYPE</SPAN> attributes.
|
---|
29 |
|
---|
30 | <P>Generally, the <CODE>METHOD</CODE> attribute specifies a method of accessing the URL specified in the <CODE>ACTION</CODE> attribute and will be either <SPAN CLASS="attr">GET</SPAN> or <SPAN CLASS="attr">POST</SPAN>. The <CODE>GET</CODE> method is ideal for form submission where the use of the form data does not require external processing. For example, with database searches, there is no lasting effect caused by the query of the form (that is, the query runs its search through the database and reports the results). However, where the form is used to provide information for example, that updates a database, then the <CODE>POST</CODE> method should be used, with the <CODE>ACTION</CODE> attribute pointing to a CGI script that executes the form data processing.
|
---|
31 |
|
---|
32 | <P>The <CODE>ENCTYPE</CODE> specifies the media type used to encode the form data. The default <CODE>ENCTYPE</CODE> is the MIME type 'application/x-www-form-urlencoded'
|
---|
33 |
|
---|
34 | <P>The <A NAME="TARGET"><CODE><FORM></CODE></A> element can also accept the <SPAN CLASS="attr">TARGET</SPAN> attribute (as in <CODE><A HREF="../Anchors/anchor.htm"><A></A></CODE> elements), to specify what window is used for any form feedback. It can take the following values :
|
---|
35 |
|
---|
36 | <DL>
|
---|
37 | <DT><EM>window_name</EM><DD>The name of any window specified by a <CODE><A HREF="../Frames/frame.htm"><FRAME></A></CODE> element, or by using the <CODE><A HREF="../Scripting_Reference/windo.htm#OPEN">window.open</A></CODE> scripting method. If a <CODE>window_name</CODE> is used which does not correlate to a previously defined window, then a new window is created and <CODE>NAME</CODE>d according the the window name used in the <CODE>TARGET</CODE> attribute. This new window can then be referenced using its new name.
|
---|
38 | <DT><EM>_self</EM><DD>Using this <EM>reserved keyword</EM> value, would cause any form feedback page to be loaded into the window that currently contains the form.
|
---|
39 | <DT><EM>_parent</EM><DD>Using this <EM>reserved keyword</EM> value, would cause any form feedback page to be loaded into the window that is the parent of the window currently containing the form. <EM>i.e.</EM> if the form's window is part of a framed document, it would load into the window controlled by the <CODE><A HREF="../Frames/fset.htm"><FRAMESET></A></CODE> element definitions that control the form's current window.
|
---|
40 | <DT><EM>_top</EM><DD>Using the <EM>reserved keyword</EM> value would cause the form feedback page to be loaded into the topmost window, clearing any currently existing framed windows.
|
---|
41 | <DT><EM>_blank</EM><DD>Using tis <EM>reserved keyword</EM> value would cause the form feedback page to be loaded into a newly created window. Using this value is the same as using <CODE>TARGET="window_name"</CODE> where the window_name used is not a previously defined window. <STRONG><EM>NOTE : </EM></STRONG>Unlike using the <CODE>window_name</CODE> using a previously undefined window name, using <CODE>_blank</CODE> will not name the new window for future use.
|
---|
42 | </DL>
|
---|
43 |
|
---|
44 | <P>the <CODE><FORM></CODE> can also take the <A NAME="NAME"><SPAN CLASS="attr">NAME</SPAN></A> attribute, which can be used to set the name of the element for scripting purposes.
|
---|
45 |
|
---|
46 | <P><A NAME="TITLE"><SPAN CLASS="attr">TITLE</SPAN></A>="informational ToolTip"<BR>
|
---|
47 | The <STRONG>Internet Explorer</STRONG> 4.0 (and above) specific <CODE>TITLE</CODE> attribute is used for informational purposes. If present, the value of the <CODE>TITLE</CODE> attribute is presented as a ToolTip when the users mouse hovers over the <CODE><FORM></CODE> section.
|
---|
48 |
|
---|
49 | <P><A NAME="LANG"><SPAN CLASS="attr">LANG</SPAN></A>="language setting"<BR>
|
---|
50 | The <CODE>LANG</CODE> attribute can be used to specify what language the <CODE><FORM></CODE> element is using. It accepts any valid ISO standard language abbreviation (for example <CODE>"en"</CODE> for English, <CODE>"de"</CODE> for German etc.) For more details, see the <A HREF="../Document_Localisation/ov.htm" TITLE="View the HTML localisation topic">Document Localisation</A> section for more details.
|
---|
51 |
|
---|
52 | <P><A NAME="LANGUAGE"><SPAN CLASS="attr">LANGUAGE</SPAN></A>="Scripting language"<BR>
|
---|
53 | The <CODE>LANGUAGE</CODE> attribute can be used to expressly specify which scripting language <STRONG>Internet Explorer</STRONG> 4.0 uses to interpret any scripting information used in the <CODE><FORM></CODE> element. It can accept values of <CODE>vbscript</CODE>, <CODE>vbs</CODE>, <CODE>javascript</CODE> or <CODE>jscript</CODE>. The first two specify the scripting language as Visual Basic Script, the latter two specify it as using Javascript (the default scripting language used if no <CODE>LANGUAGE</CODE> attribute is set.
|
---|
54 |
|
---|
55 | <P><A NAME="CLASS"><SPAN CLASS="attr">CLASS</SPAN></A>="Style Sheet class name"<BR>
|
---|
56 | The <CODE>CLASS</CODE> attribute is used to specify the <CODE><FORM></CODE> element as using a particular style sheet class. See the <A HREF="../Style_Sheets/ov.htm" TITLE="View the Style Sheets overview">Style Sheets</A> topic for details.
|
---|
57 |
|
---|
58 | <P><A NAME="STYLE"><SPAN CLASS="attr">STYLE</SPAN></A>="In line style setting"<BR>
|
---|
59 | As well as using previously defined style sheet settings, the <CODE><FORM></CODE> element can have in-line stylings attached to it. See the <A HREF="../Style_Sheets/ov.htm" TITLE="View the Style Sheets overview">Style Sheets</A> topic for details.
|
---|
60 |
|
---|
61 | <P><A NAME="ID"><SPAN CLASS="attr">ID</SPAN></A>="Unique element identifier"<BR>
|
---|
62 | The <CODE>ID</CODE> attribute can be used to either reference a unique style sheet identifier, or to provide a unique name for the <CODE><FORM></CODE> element for scripting purposes. Any <CODE><FORM></CODE> element with an <CODE>ID</CODE> attribute can be directly manipulated in script by referencing its <CODE>ID</CODE> attribute, rather than working through the <A HREF="../Scripting_Reference/allcol.htm" TITLE="View the All collection topic">All collection</A> to determine the element. See the <A HREF="../Scripting_Reference/ov.htm" TITLE="View the Scripting Introduction topic">Scripting introduction</A> topic for more information.
|
---|
63 |
|
---|
64 | <P><HR WIDTH="75%" ALIGN="center">
|
---|
65 |
|
---|
66 | <P><A NAME="SCRIPTING">Every</A> <CODE><FORM></CODE> element in a document is an object that can be manipulated through scripting. Both <STRONG>Netscape</STRONG> and <STRONG>Internet Explorer</STRONG> support scripting of the <CODE><FORM></CODE> object - <STRONG>Netscape</STRONG> supporting it through the <A HREF="../Scripting_Reference/formcol.htm" TITLE="View the Forms collection topic">Forms collection</A>forms array, but <STRONG>Internet Explorer</STRONG>'s <A HREF="../Dynamic_HTML/dhtml.htm" TITLE="View the Dynamic HTML overview">Dynamic HTML</A> support is more varied.
|
---|
67 |
|
---|
68 | <P><A NAME="FORM_Properties" TITLE=""><STRONG><CODE><FORM...></CODE> Properties</STRONG></A><BR>
|
---|
69 | The <CODE><FORM...></CODE> element/object supports <EM>all</EM> of the standard <A HREF="../Dynamic_HTML/dhtml.htm" TITLE="View the Dynamic HTML overview topic">Dynamic HTML</A> properties (i.e. <SPAN CLASS="attr">className</SPAN>, <SPAN CLASS="attr">document</SPAN>, <SPAN CLASS="attr">id</SPAN>, <SPAN CLASS="attr">innerHTML</SPAN>, <SPAN CLASS="attr">innerText</SPAN>, <SPAN CLASS="attr">isTextEdit</SPAN>, <SPAN CLASS="attr">lang</SPAN>, <SPAN CLASS="attr">language</SPAN>, <SPAN CLASS="attr">offsetHeight</SPAN>, <SPAN CLASS="attr">offsetLeft</SPAN>, <SPAN CLASS="attr">offsetParent</SPAN>, <SPAN CLASS="attr">offsetTop</SPAN>, <SPAN CLASS="attr">offsetWidth</SPAN>, <SPAN CLASS="attr">outerHTML</SPAN>, <SPAN CLASS="attr">outerText</SPAN>, <SPAN CLASS="attr">parentElement</SPAN>, <SPAN CLASS="attr">parentTextEdit</SPAN>, <SPAN CLASS="attr">sourceIndex</SPAN>, <SPAN CLASS="attr">style</SPAN>, <SPAN CLASS="attr">tagName</SPAN> and <SPAN CLASS="attr">title</SPAN>). Details of these can be found in the <A HREF="../Dynamic_HTML/dhtmlp.htm" TITLE="View the standard Dynamic HTML Properties topic">standard Dynamic HTML properties</A> topics.<BR>
|
---|
70 | The <CODE><FORM></CODE> object also supports the following properties:
|
---|
71 |
|
---|
72 | <P><SPAN CLASS="attr">action</SPAN>, <SPAN CLASS="attr">encoding</SPAN>, <SPAN CLASS="attr">method</SPAN>, <SPAN CLASS="attr">name</SPAN> and <SPAN CLASS="attr">target</SPAN>, all of which directly reflect (or set) their respective attribute values (with the <CODE>encoding</CODE> property reflecting the <CODE>ENCTYPE</CODE> attribute)
|
---|
73 |
|
---|
74 | <P><A NAME="FORM_Methods" TITLE=""><STRONG><CODE><FORM...></CODE> Methods</STRONG></A><BR>
|
---|
75 | The <CODE><FORM...></CODE> element/object supports <EM>all</EM> of the standard <A HREF="../Dynamic_HTML/dhtml.htm" TITLE="View the Dynamic HTML overview topic">Dynamic HTML</A> methods (i.e. <SPAN CLASS="attr">click</SPAN>, <SPAN CLASS="attr">contains</SPAN>, <SPAN CLASS="attr">getAttribute</SPAN>, <SPAN CLASS="attr">insertAdjacentHTML</SPAN>, <SPAN CLASS="attr">insertAdjacentText</SPAN>, <SPAN CLASS="attr">removeAttribute</SPAN>, <SPAN CLASS="attr">scrollIntoView</SPAN> and <SPAN CLASS="attr">setAttribute</SPAN>). Details of these can be found in the <A HREF="../Dynamic_HTML/dhtmlm.htm" TITLE="View the standard Dynamic HTML Methods topic">standard Dynamic HTML Methods</A> topics.<BR>
|
---|
76 | The <CODE><FORM></CODE> element also supports the <SPAN CLASS="attr">submit</SPAN> and <SPAN CLASS="attr">reset</SPAN> methods, which submit, or reset the form respectively.
|
---|
77 |
|
---|
78 | <P><A NAME="FORM_Events" TITLE=""><STRONG><CODE><FORM...></CODE> Events</STRONG></A><BR>
|
---|
79 | The <CODE><FORM...></CODE> element/object supports <EM>all</EM> of the standard <A HREF="../Dynamic_HTML/dhtml.htm" TITLE="View the Dynamic HTML overview topic">Dynamic HTML</A> events (i.e. <SPAN CLASS="attr">onclick</SPAN>, <SPAN CLASS="attr">ondblclick</SPAN>, <SPAN CLASS="attr">ondragstart</SPAN>, <SPAN CLASS="attr">onfilterchange</SPAN>, <SPAN CLASS="attr">onhelp</SPAN>, <SPAN CLASS="attr">onkeydown</SPAN>, <SPAN CLASS="attr">onkeypress</SPAN>, <SPAN CLASS="attr">onkeyup</SPAN>, <SPAN CLASS="attr">onmousedown</SPAN>, <SPAN CLASS="attr">onmousemove</SPAN>, <SPAN CLASS="attr">onmouseout</SPAN>, <SPAN CLASS="attr">onmouseover</SPAN>, <SPAN CLASS="attr">onmouseup</SPAN> and <SPAN CLASS="attr">onselectstart</SPAN>). Details of these can be found in the <A HREF="../Dynamic_HTML/dhtmle.htm" TITLE="View the standard Dynamic HTML Events topic">standard Dynamic HTML events</A> topics.<BR>
|
---|
80 | <SPAN CLASS="attr">onreset</SPAN> and <SPAN CLASS="attr">onsubmit</SPAN> are also supported events of the <CODE><FORM></CODE> element, firing when the form is reset, or submitted respectively.
|
---|
81 |
|
---|
82 |
|
---|
83 | <P>
|
---|
84 |
|
---|
85 | <P ALIGN="right" CLASS="copyright">© 1995-1998, Stephen Le Hunte</P>
|
---|
86 | </BODY>
|
---|
87 | </HTML>
|
---|