0

I know u can do something like this

$('#labelID').off('click'); // unbind click event
$('#labelID').no('click',func); bind it back with a func

but to rebind back in my case I don't have a function, because it is the default behavior of my form upload tags, like

<label>upload
<input type="file">
</label>
James Lemon
  • 426
  • 5
  • 17

2 Answers2

2

I think what you are trying to do is to, disable the file selection based on some condition, in that case I think you can just disable in file input field.

$('input[type="file"]').prop('disabled', true)
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
0

Use this

$('input[type="file"]').attr('disabled', 'disabled');
I'm Geeker
  • 4,601
  • 5
  • 22
  • 41