Javascript Reference
Categories: InputTypeSubmit

javascript InputTypeSubmit Description

@March 15, 2008, 1:22 a.m.
input (type="submit")Firefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM 1  

  

The submit object is a form control generated with an input element that has a type attribute 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 or button-type input object instead. Otherwise, the submit object automatically reloads the current document (i.e., obeying the form's default action, which is the page's URL), 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. The scripted equivalent of a submit-type input object is the form object's submit( ) method.

 
HTML Equivalent
 
<input type="submit">
 
Object Model Reference
 
[window.]document.formName.elementName
[window.]document.forms[i].elements[i]
[window.]document.getElementById("elementID")
 
Object-Specific Properties
 
formnametypevalue
 
Object-Specific Methods
 
createTextRange( )handleEvent[ ]
 
Object-Specific Event Handler Properties
 
HandlerFirefox/Netscape/NNIEChrome/Safari/DOM
onblur642
onclick342
onfocus642
onmousedown442
onmousemove642
onmouseout642
onmouseover642
onmouseup442

Powered by Linode.