AvailabilityJavaScript 1.0; enhanced in JavaScript 1.1 Inherits from/OverridesInherits from Input, HTMLElement Synopsisform.name form.elements[i] form.elements['name'] PropertiesSubmit inherits properties from Input and HTMLElement and defines or overrides the following:
MethodsSubmit inherits methods from Input and HTMLElement. Event HandlersSubmit inherits event handlers from Input and HTMLElement and defines or overrides the following:
HTML SyntaxA Submit object is created with a standard HTML <input> tag: <form> ... <input type="submit" // Specifies that this is a Submit button [ value="label" ] // The text that is to appear within the button // Specifies the value property [ name="name" ] // A name you can use later to refer to the button // Specifies the name property [ onclick="handler" ] // JavaScript statements to be executed when the button // is clicked > ... </form> Submit objects can also be created with the HTML 4 <button> tag: <button id="name" type="submit" value="value" onclick="handler">label </button> DescriptionThe Submit element has the same properties and methods as the Button object but has a more specialized purpose. When a Submit button is clicked, it submits the data in the form that contains the button to the server specified by the form's action attribute and loads the resulting HTML page sent back by that server. In JavaScript 1.1, the exception is that the form is not submitted if either the Submit.onclick or Form.onsubmit event handler returns false. Note that in JavaScript 1.1 the Form.submit( ) method provides an alternative way to submit a form. If no value attribute is specified for a Submit object, it is typically labeled "Submit Query". In some forms, it may make more sense to label the button "Submit", "Done", or "Send". See AlsoButton, Form.onsubmit, Form.submit( ), HTMLElement, Input; HTMLInputElement in the DOM reference section |