Availability: |
| |||||||
Inherits from: | Input object | |||||||
JavaScript syntax: | - | mySubmitButton = myDocument.aFormName.anElementName | ||||||
- | mySubmitButton = myDocument.aFormName.elements[anItemIndex] | |||||||
IE | mySubmitButton = myDocument.all.anElementID | |||||||
IE | mySubmitButton = myDocument.all.tags("INPUT")[anIndex] | |||||||
IE | mySubmitButton = myDocument.all[aName] | |||||||
- | mySubmitButton = myDocument.forms[aFormIndex].anElementName | |||||||
- | mySubmitButton = myDocument.forms[aFormIndex].elements[anItemIndex] | |||||||
- | mySubmitButton = myDocument.getElementById(anElementID) | |||||||
- | mySubmitButton = myDocument.getElementsByName(aName)[anIndex] | |||||||
- | mySubmitButton = myDocument.getElementsByTagName("INPUT")[anIndex] | |||||||
HTML syntax: | <INPUT TYPE="submit"> | |||||||
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: | type, value | |||||||
Object methods: | handleEvent() | |||||||
Event handlers: | onAfterUpdate, onBeforeUpdate, onBlur, onClick, onDblClick, onFilterChange, onFocus, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onRowEnter, onRowExit |
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 subclasses of the Input object superclass.
There isn't really a SubmitButton 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 submit button. 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 SubmitButton objects at version 1.1 of JavaScript.
Unlike MSIE, Netscape Navigator does not support the select() method or defaultValue property for this subclass of the Input object.
<HTML> <HEAD> </HEAD> <BODY> <FORM> <SELECT ID="IN1"> <OPTION VALUE="-1">Please select an item <OPTION VALUE="0">Sunday <OPTION VALUE="1">Monday <OPTION VALUE="2">Tuesday <OPTION VALUE="3">Wednesday <OPTION VALUE="4">Thursday <OPTION VALUE="5">Friday <OPTION VALUE="6">Saturday </SELECT> <INPUT ID="SUBMIT" TYPE="Submit" VALUE="CLICK ME" onClick="clickMe()"> </FORM> <SCRIPT> //MSIE only function clickMe() { selectedValue = document.all.IN1.value; if(selectedValue == -1) { alert("You must select an item first!"); } else { document.all.SUBMIT.click() } } </SCRIPT> </BODY> </HTML>
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
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 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
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 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onClick | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onDblClick | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.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.0 ![]() | 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 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
Subclasses | Up | SubmitButton.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. |