HTML DOM Input submit disabled प्रॉपर्टी का उपयोग यह सेट या वापस करने के लिए किया जाता है कि सबमिट बटन को अक्षम किया जाना चाहिए या नहीं। यह बूलियन मानों का उपयोग करता है जिसमें true दर्शाता है कि सबमिट बटन को अक्षम किया जाना चाहिए और false अन्यथा। disabled प्रॉपर्टी डिफ़ॉल्ट रूप से false पर सेट होती है। हालांकि, अक्षम एलिमेंट डिफ़ॉल्ट रूप से ग्रे आउट होता है और अनक्लिकेबल होता है।
सिंटैक्स
Disabled प्रॉपर्टी सेट करने का सिंटैक्स:
submitObject.disabled = true|false
यहां, true = सबमिट बटन अक्षम है और false = सबमिट बटन अक्षम नहीं है। यह डिफ़ॉल्ट रूप से false है।
उदाहरण
Input submit disabled प्रॉपर्टी का एक उदाहरण देखते हैं:
<!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 बटन पर क्लिक करके ऊपर वाले रीसेट बटन को अक्षम करें</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>
आउटपुट
यह निम्नलिखित आउटपुट उत्पन्न करेगा:

DISABLE बटन पर क्लिक करने पर:
