Javascript Submit Object
The Submit object represents a submit button in an HTML form. For each instance of an <input type="submit"> tag in an HTML form, a Submit object is created.
You can access a Submit object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
Javascript Submit Object Properties
Property |
Description |
IE |
F |
N |
W3C |
accept |
Sets or returns a list of content types, which the server processing this form will handle correctly |
- |
|
|
Yes |
accessKey |
Sets or returns the keyboard key to access the submit button |
4 |
|
|
Yes |
align |
Sets or returns the alignment of the submit button according to the surrounding text |
- |
|
|
Yes |
alt |
Sets or returns an alternate text to display if the browser does not support submit buttons |
- |
|
|
Yes |
defaultValue |
Sets or returns the default value of the submit button |
3 |
|
|
Yes |
disabled |
Sets or returns whether or not the submit button should be disabled |
5 |
1 |
|
Yes |
form |
Returns a reference to the submit button's parent form |
3 |
1 |
2 |
Yes |
id |
Sets or returns the id of the submit button (In IE 4 this property is read-only) |
4 |
1 |
|
Yes |
name |
Sets or returns the name of the submit button |
3 |
1 |
2 |
Yes |
size |
Sets or returns the size of the submit button |
3 |
|
|
Yes |
tabIndex |
Sets or returns the tab order for the submit button |
4 |
|
|
Yes |
type |
Returns the type of the form element. For a submit object it will always be "submit" |
3 |
1 |
3 |
Yes |
value |
Sets or returns the value of the value attribute of the submit button |
3 |
1 |
2 |
Yes |
Javascript Submit Object Methods
Method |
Description |
IE |
F |
N |
W3C |
blur() |
Removes focus from the submit button |
4 |
1 |
|
Yes |
click() |
Simulates a mouse-click on the submit button |
4 |
1 |
2 |
Yes |
focus() |
Sets focus on the submit button |
3 |
1 |
|
Yes |
select() |
Selects the submit button |
4 |
1 |
|
No |
Javascript Submit Object Events
Syntax: object.event_name="someJavaScriptCode"
Event |
Description |
IE |
F |
N |
W3C |
onBlur |
Executes some code when the submit button loses focus |
4 |
|
|
|
onClick |
Executes some code when the user clicks on the submit button |
4 |
1 |
2 |
|
onFocus |
Executes some code when the submit button gets focus |
3 |
|
|
|
onSelectStart |
Executes some code when the submit button is selected |
4 |
1 |
4 |
|
|