Input FileUpload disabled Property - Disable and enable a FileUpload button: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input FileUpload

Description

Input FileUpload disabled Property - Disable and enable a FileUpload button:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

Get Image: <input type="file" id="myFile">
<br>

<button onclick="disableBtn()">Disable File Upload</button>
<button onclick="enableBtn()">Enable File Upload</button>

<script>
function disableBtn() {//  w ww. java  2  s . c  om
    document.getElementById("myFile").disabled = true;
}

function enableBtn() {
    document.getElementById("myFile").disabled = false;
}
</script>

</body>
</html>

Related Tutorials