Hi Sirs,
I need to see others buttons staying disabled when the specific button is clicked.
When you click on the button the rest of buttons just stay one second disabled (Late come back able).
I known that is because of the submit's type button. But I need to keep these buttons as submit's type. How can I resolv it please. Thanks.
If I am not clear. Please inform me.
<form action="company.php" method="post">
<input type="text" name="data_field" placeholder="Enter data">
<button type="submit" id="button3" onclick="disableOtherButton3()">Click to Disable</button>
<button type="submit" id="button1" onclick="disableOtherButton1()">1</button>
<button type="submit" id="button2" onclick="disableOtherButton2()">2</button>
<button type="submit" id="button4" onclick="disableOtherButton4()">4</button>
</form>
<script>
function disableOtherButton1() {
document.getElementById("button3").disabled = true;
document.getElementById("button2").disabled = true;
document.getElementById("button4").disabled = true;
}
</script>
<script>
function disableOtherButton3() {
document.getElementById("button1").disabled = true;
document.getElementById("button2").disabled = true;
document.getElementById("button4").disabled = true;
}
</script>
<script>
function disableOtherButton2() {
document.getElementById("button3").disabled = true;
document.getElementById("button1").disabled = true;
document.getElementById("button4").disabled = true;
}
</script>
<script>
function disableOtherButton4() {
document.getElementById("button3").disabled = true;
document.getElementById("button2").disabled = true;
document.getElementById("button1").disabled = true;
}
</script>