Availability: |
| |||||||
Inherits from: | Input object | |||||||
JavaScript syntax: | - | myTextCell = myDocument.aFormName.anElementName | ||||||
- | myTextCell = myDocument.aFormName.elements[anItemIndex] | |||||||
IE | myTextCell = myDocument.all.anElementID | |||||||
IE | myTextCell = myDocument.all.tags("INPUT")[anIndex] | |||||||
IE | myTextCell = myDocument.all[aName] | |||||||
- | myTextCell = myDocument.forms[aFormIndex].anElementName | |||||||
- | myTextCell = myDocument.forms[aFormIndex].elements[anItemIndex] | |||||||
- | myTextCell = myDocument.getElementById(anElementID) | |||||||
- | myTextCell = myDocument.getElementsByName(aName)[anIndex] | |||||||
- | myTextCell = myDocument.getElementsByTagName("INPUT")[anIndex] | |||||||
HTML syntax: | <INPUT TYPE="text"> | |||||||
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: | maxLength, readOnly, size, type, value | |||||||
Object methods: | handleEvent(), select() | |||||||
Event handlers: | onAfterUpdate, onBeforeUpdate, onBlur, onChange, onFilterChange, onFocus, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onRowEnter, onRowExit, onSelect |
Many properties, methods and event handlers are inherited from the Input object class. Refer to topics grouped with the "Input" prefix for details of common functionality across all sub-classes of the Input object super-class.
There isn't really a TextCell object class, but it is helpful when trying to understand the wide variety of input element types if we can reduce the complexity by discussing only the properties and methods of a text cell. In actual fact, the object is represented as an item of the Input object class.
Event handling support via properties containing function objects was added to TextCell objects at version 1.1 of JavaScript.
The Netscape implementation of this sub-class of the Input object does not support as wide a variety of events as the MSIE implementation. In particular, the keyboard events are not supported.
The WebTV set-top box does not support the onkeypress event handler for this object type prior to the Summer 2000 release.
<HTML> <HEAD> </HEAD> <BODY> <DIV ID="RESULT">?</DIV> <FORM> <INPUT TYPE="text" VALUE="" NAME="BOX_A"><BR> <INPUT TYPE="text" VALUE="" NAME="BOX_B"><BR> <INPUT TYPE="text" VALUE="" NAME="BOX_C"><BR> <INPUT TYPE="text" VALUE="" NAME="BOX_D"><BR><BR> <INPUT TYPE="button" VALUE="Reveal" onClick="handleClick()"> </FORM> <SCRIPT> function handleClick() { myString = "["; myString += document.forms[0].elements.BOX_A.value; myString += "] ["; myString += document.forms[0].elements.BOX_B.value; myString += "] ["; myString += document.forms[0].elements.BOX_C.value; myString += "] ["; myString += document.forms[0].elements.BOX_D.value; myString += "]"; document.all.RESULT.innerText = myString; } </SCRIPT> </BODY> </HTML>
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
maxLength | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
readOnly | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
size | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
type | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly. |
value | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
handleEvent() | 1.2 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
select() | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.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 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onFilterChange | ![]() | 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 |
TEXTAREA.wrap | Up | TextCell.handleEvent() |
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. |