
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Input Submit form property
The HTML DOM Input Submit form property is used for returning the form reference that contains the given submit button. If the submit button is outside the form then it will simply return NULL. This property is read-only.
Syntax
Following is the syntax for input submit form property −
submitObject.form
Example
Let us look at an example for the Input Submit form property −
<!DOCTYPE html> <html> <body> <h1>Input submit form Property</h1> <form action="Sample_page.php" id="FORM_1" style="border:solid 2px green;padding:2px"> UserName: <input type="text" id="USR"> <br> Location: <input type="text" id=“Loc”> <br><br> <input type="submit" id="SUBMIT1"> </form> <p>Get the form id by clicking on the below button</p> <button type="button" onclick="formId()">GET FORM</button> <p id="Sample"></p> <script> function formId() { var P=document.getElementById("SUBMIT1").form.id; document.getElementById("Sample").innerHTML = "The id of the form containing the submit button is: "+P ; } </script> </body> </html>
Output
This will produce the following output −
On clicking the GET FORM −
- Related Articles
- HTML DOM Input Submit autofocus property
- HTML DOM Input Submit disabled property
- HTML DOM Input Submit formAction property
- HTML DOM Input Submit formEnctype property
- HTML DOM Input Submit formMethod property
- HTML DOM Input Submit formNoValidate property
- HTML DOM Input Submit formTarget property
- HTML DOM Input Submit name property
- HTML DOM Input Submit object property
- HTML DOM Input Submit type Property
- HTML DOM Input Submit value Property
- HTML DOM Input Button form Property
- HTML DOM Input FileUpload form Property
- HTML DOM Input Hidden form Property
- HTML DOM Input Month form Property

Advertisements