INPUTINPUT*
*Contents  *Index  *Topic Contents
*Previous Topic: IMG
*Next Topic: INS

INPUT

Description

Specifies a form input control.

Syntax

<INPUT
ACCESSKEY=key
ALIGN=LEFT | CENTER | RIGHT
ALT=text
CLASS=classname
DISABLED
DYNSRC=url
ID=value
LANG=language
LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT | VBS
LOWSRC=url
MAXLENGTH=n
NAME=name
READONLY
SIZE=n
SRC=url
STYLE=css1-properties
TABINDEX=n
TITLE=text
TYPE=BUTTON | CHECKBOX | FILE | HIDDEN | IMAGE | PASSWORD | RADIO | RESET | SUBMIT | TEXT
VALUE=value
event = script
>

ParameterDescription
ACCESSKEY=key Specifies an accelerator for the element. Pressing alt-key selects this element in the user's browser. This attribute applies to the BUTTON, CHECKBOX, FILE, PASSWORD, RADIO, RESET, SUBMIT, and TEXT input types.
ALIGN=LEFT | CENTER | RIGHT Displays the element left flush, right flush, or centered relative to the display or table when TYPE=IMAGE..
ALT=text When TYPE=IMAGE, optional text as an alternative to the graphic for rendering in non-graphical environments. Alternate text should be provided whenever the graphic is not rendered. Alternate text is mandatory for Level 0 documents.
CLASS=classname Specifies the class of the tag being defined. This is used to associate a sub-classed style sheet with the tag.
DISABLED Used to disable an element. This attribute prevents an element from receiving the focus, and causes the element to appear "grayed out."
DYNSRC=url Specifies the address of a video clip or VRML world to be displayed in the window. Stands for Dynamic Source. Applies to type=image only.
ID=value An SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underbar character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.
LANG=language Specifies which language to use in ISO standard language abbreviation form.
LANGUAGE=JAVASCRIPT | JSCRIPT | VBS | VBSCRIPT Specifies the language the current script is written in and invokes the proper scripting engine. The default value is JAVASCRIPT.
JAVASCRIPT, JSCRIPT The scripting language is written in JavaScript.
VBS, VBSCRIPT The scripting language is written in VBScript.
LOWSRC=url Specifies a lower resolution image to display. Applies to type=image only.
MAXLENGTH=n Indicates the maximum number of characters that can be entered into a text control. This attribute applies to the PASSWORD and TEXT input types.
NAME=name Specifies the name of the control, bookmark, or application.
READONLY Causes the element's contents to be read only. The INPUT element can still receive the focus. This attribute applies to the PASSWORD and TEXT input types.
SIZE=n Specifies the size of the control.
SRC=url Specifies a URL for the associated file. This attribute applies to the IMAGE type.
STYLE=css1-properties Specifies an in-line style sheet for the tag.
TABINDEX=n Sets the tab order position for the object. This attribute applies to the BUTTON, CHECKBOX, FILE, PASSWORD, RADIO, RESET, SUBMIT, and TEXT input types.
TITLE=text Used to provide advisory information. The contents of the title attribute will be displayed in a ToolTip during the onmouseover event.
TYPE=BUTTON | CHECKBOX | FILE | HIDDEN | IMAGE | PASSWORD | RADIO | RESET | SUBMIT | TEXT Specifies the type of intrinsic control. The default is TEXT.
BUTTON A button on the HTML form.
CHECKBOX Used for simple Boolean attributes or for attributes that can take multiple values at the same time. It is represented by a number of check box fields, each of which has the same name. Each selected check box generates a separate name/value pair in the submitted data, even if this results in duplicate names. The default value for check boxes is on.
FILE A file upload element that allows the user to supply a file as the input.
HIDDEN No field is presented to the user, but the content of the field is sent with the submitted form. This value can be used to transmit state information about client/server interaction.
IMAGE An image field that you can click, causing the form to be immediately submitted. The coordinates of the selected point are measured in pixel units from the upper-left corner of the image, and are returned (along with the other contents of the form) in two name/value pairs. The x-coordinate is submitted under the name of the field with ".x" appended, and the y-coordinate is submitted under the name of the field with ".y" appended. Any VALUE= attribute is ignored. The image itself is specified by the SRC= attribute, exactly as for the IMG element.
PASSWORD The same as the TEXT input type, except that text is not displayed as the user enters it.
RADIO Used for attributes that accept a single value from a set of alternatives. Each radio-button field in the group should be given the same name. Only the selected radio button in the group generates a name/value pair in the submitted data. Radio buttons require an explicit VALUE= attribute.
RESET When pressed, this button resets the form's fields to their specified initial values. The label to be displayed on the button may be specified just as for the SUBMIT button.
SUBMIT Submits the form. The default label is application-specific. If a SUBMIT button is pressed in order to submit the form, and that button has a NAME attribute specified, then that button contributes a name/value pair to the submitted data. Otherwise, a SUBMIT button makes no contribution to the submitted data.
TEXT Used for a single-line text-entry field. Use in conjunction with the SIZE= and MAXLENGTH= attributes.
VALUE=value For textual/numerical controls, specifies the default value of the control. For Boolean controls, specifies the value to be returned when the control is turned on. This attribute applies to the BUTTON, CHECKBOX, HIDDEN, PASSWORD, RADIO, RESET, SUBMIT, and TEXT input types.
event Can be one or more of these events:
onafterupdate onbeforeupdate
onblur onchange
onclick ondblclick
ondragstart onfocus
onhelp onkeydown
onkeypress onkeyup
onmousedown onmousemove
onmouseout onmouseover
onmouseup onselect
onselectstart

Remarks

Objects can be submitted in forms. The NAME is the identifier of the object tag (i.e., <OBJECT NAME=slider CLASSID=...>), and the VALUE is obtained by getting the value of the default property of the control. If any of the following conditions occur, then the object will not become part of the submit string:
Object did not instantiate
Object does not have an identifier
Object does not have a default property to get
Default property cannot be coerced into a string

Example

<FORM ACTION="http://intranet/survey" METHOD=POST>
<P>Name
<BR><INPUT NAME="CONTROL1" TYPE=TEXT VALUE="Your Name">
<P>Password
<BR><INPUT TYPE="PASSWORD" NAME="CONTROL2">
<P>Color
<BR><INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="0" CHECKED>Red
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="1">Green
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="2">Blue
<P>Comments
<BR><INPUT TYPE="TEXT" NAME="CONTROL4" SIZE="20,5" MAXLENGTH="250">
<P><INPUT NAME="CONTROL5" TYPE=CHECKBOX CHECKED>Send receipt
<P><INPUT TYPE="SUBMIT" VALUE="OK"><INPUT TYPE="RESET" VALUE="Reset">
</FORM>

Scripting Object

INPUT

See Also

TEXT, BUTTON, IMG, TEXTAREA, OBJECT


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.