I wanted to disable the input using the following code that is called when a button is pressed using Bootstrap FileStyle(for reference I used this link Link to the documentation ):
function disableInput(e) {
$(":file").filestyle({disabled: true});
}
The input is defined as follows:
<input type="file" class="filestyle" required="required" data-buttontext="Browse for new script">
But when disableInput is called, the input is not disabled, does not gray out and the file chooser is still triggered when "Browse for new script" is clicked, even though while debugging I can see it being called on.
Setting the data-disabled="true"
attribute of the input works, like in the sample code provided in the documentation under "disabled", but it is not what I need.
Any ideas where I went wrong?