O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

submit — NN 2 IE 3 DOM 1

Synopsis

The submit object is a form control generated with an INPUT element whose TYPE attribute is set to "submit". This object is similar to the button object, but a submit object has more implied power. No script action is necessary for the submit object to do its job of submitting the containing form to the server. If you require a button to perform a script action, but not an actual form submission, use the button object instead. Otherwise, the submit object automatically reloads the current document, perhaps destroying important script variables. To initiate form validation, use the onSubmit event handler of the form object rather than the onClick event handler of the submit button. If the event handler evaluates to true, the form is submitted; if it evaluates to false, the submission is cancelled.

HTML Equivalent

<INPUT TYPE="submit">

Object Model Reference

NN

[window.]document. formName . elementName

[window.]document.forms[i].elements[i]

IE

[window.]document. formName . elementName

[window.]document.forms[i].elements[i]

[window.]document.all. elementID

Properties

accessKey

isTextEdit

offsetLeft

outerText

tabIndex

className

lang

offsetParent

parentElement

tagName

disabled

language

offsetTop

parentTextEdit

title

document

name

offsetWidth

sourceIndex

type

form

offsetHeight

outerHTML

style

value

id

    

Methods

blur( )

getAttribute( )

removeAttribute( )

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required