Is there any way where i can stop "no file chosen
" for input type file.
<input type="file" id="field-id" name="html" />
Remove the value('No file chosen'). Use . addClass() method to add the class which removes the value “No file chosen”.
Hide the input with css, add a label and assign it to input button. label will be clickable and when clicked, it will fire up the file dialog. Then style the label as a button if you want. This even works in IE9, where you can't hide the file input and click it from JavaScript.
You can't get rid of the 'no file chosen' entirely, but you can change the text to something that makes sense by setting the title.
<input type="file" title="foo">
will display "foo" on mouseover instead of "no file chosen"
unfortunately,
<input type="file" title="">
doesn't work like you might hope.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With