
- 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 disabled property
The HTML DOM Input submit disabled property is used for setting or returning if the submit button should be disabled or not. It uses boolean values with true representing the submit button should be disabled and false otherwise. The disabled property is set to false by default. However, the disabled element is greyed out by default and is unclickable .
Syntax
Following is the syntax for −
Setting the disabled property −
submitObject.autofocus = true|false
Here, true=submit button is disabled and false=the submit button is not disabled. It is false by default.
Example
Let us look at an example for the Input submit disabled property −
<!DOCTYPE html> <html> <body> <h1>Input submit disabled Property</h1> <form action=”/Sample_page.php” 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>Disable the above reset button by clicking on the DISABLE button</p> <button type="button" onclick="disableSubmit()">DISABLE</button> <p id="Sample"></p> <script> function disableSubmit() { document.getElementById("SUBMIT1").disabled=true; document.getElementById("Sample").innerHTML = "The submit button is now disabled" ; } </script> </body> </html>
Output
This will produce the following output −
On clicking the DISABLE button −
- Related Articles
- HTML DOM Input Submit autofocus property
- HTML DOM Input Submit form 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 URL disabled Property
- HTML DOM Input Week disabled Property
- HTML DOM Input Password disabled Property
- HTML DOM Input Search disabled Property

Advertisements