Availability: |
| ||||||
Inherits from: | Element object | ||||||
JavaScript syntax: | - | myInput = myDocument.aFormName.anElementName | |||||
- | myInput = myDocument.aFormName.elements[anItemIndex] | ||||||
IE | myInput = myDocument.all.anElementID | ||||||
IE | myInput = myDocument.all.tags("INPUT")[anIndex] | ||||||
IE | myInput = myDocument.all[aName] | ||||||
- | myInput = myDocument.forms[aFormIndex].anElementName | ||||||
- | myInput = myDocument.forms[aFormIndex].elements[anItemIndex] | ||||||
- | myInput = myDocument.getElementById(anElementID) | ||||||
- | myInput = myDocument.getElementsByName(aName)[anIndex] | ||||||
- | myInput = myInputArray[aName] | ||||||
- | myInput = myInputArray[anIndex] | ||||||
- | myInput = myDocument.getElementsByTagName("INPUT")[anIndex] | ||||||
HTML syntax: | <INPUT TYPE="aType"> | ||||||
Argument list: | anIndex | A valid reference to an item in the collection | |||||
aName | The name attribute of an element | ||||||
anElementID | The ID attribute of an element | ||||||
anItemIndex | A valid reference to an item in the collection | ||||||
aFormIndex | A reference to a particular form in the forms collection | ||||||
Object properties: | accept, accessKey, align, alt, checked, dataFld, dataFormatAs, dataSrc, defaultChecked, defaultSelected, defaultValue, disabled, form, length, maxLength, name, readOnly, recordNumber, selected, selectedIndex, size, src, status, tabIndex, type, value | ||||||
Object methods: | blur(), click(), createTextRange(), focus(), handleEvent(), select() | ||||||
Event handlers: | onAfterUpdate, onBeforeUpdate, onBlur, onChange, onClick, onDblClick, onFocus, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onRowEnter, onRowExit, onSelect |
This is a generic description of a form element object. The object will really be a concrete manifestation of a particular class, but is available generally as an item in the elements array that belongs to the form.
We have tried to conceive a general model of the object relationships in a browser, a difficult task - we document a general purpose class referred to as an Element object. Most displayable items in a document that are instantiated by an HTML tag can be considered to be sub-classes of the Element object.
Input objects, collectively, are a sub-class of the Element object class so to avoid over-duplicating the same coverage, properties, methods, events and collections that are specific to Input objects are discussed here and are omitted from the discussion topics relating to the Element object. They are listed in the property, method, collection and event summary for the Element object.
Likewise, under the Input object, those properties, method, collections and events that apply generally to all kinds of Input objects are documented here, but those that are specific to only a particular kind of Input object sub-class are covered under specific topics relating to that class.
Some properties and methods of the Input objects and its specific sub-classes are platform specific. The dataFld, dataSrc and dataFormatAs properties are only available in MSIE. Assigning event handlers to onevent properties may also support different event sets in each browser platform.
MSIE supports an INPUT object class rather than an Input object class.
Note that on MSIE, Input objects are actually INPUT objects because MSIE follows a general rule of naming object classes after the capitalised name of the HTML tag that instantiates them.
Beware that although a small sub-set of the complete range of properties and methods are supported on all browsers, there are many properties and methods that are only available on one browser or the other.
See also: | FIELDSET object, ISINDEX object, Label object, Legend object |
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
accept | 1.5 ![]() | 5.0 ![]() | 6.0 ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
accessKey | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
align | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
alt | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
checked | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
dataFld | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
dataFormatAs | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
dataSrc | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
defaultChecked | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
defaultSelected | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
defaultValue | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly. |
disabled | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
form | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly. |
length | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
maxLength | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
name | 1.5 ![]() | 5.5 ![]() | 6.0 ![]() | 5.5 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
readOnly | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
recordNumber | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
selected | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
selectedIndex | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
size | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
src | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
status | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
tabIndex | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
type | 1.1 ![]() | 1.0 ![]() | 3.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly. |
value | 1.5 ![]() | 1.0 ![]() | 6.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
blur() | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
click() | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
createTextRange() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
focus() | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
handleEvent() | 1.2 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
select() | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
Event name | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
onAfterUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onBeforeUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onBlur | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onChange | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onClick | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onDblClick | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onFocus | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onHelp | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onKeyDown | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyPress | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyUp | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseDown | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseMove | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOut | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOver | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseUp | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onRowEnter | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onRowExit | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onSelect | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
Input event | Up | Input.accept |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |