Banny
Banny

Reputation: 841

How to signal that file has been selected when the input type="file" is hidden?

I have done some styling to my input form for files so that it looks how the rest of the form looks, everything is working perfectly fine but I just noticed you cannot tell when you have got a file selected. Is there a way of being able to set the <p> tag which I have used as a mask to display the given filename/path? Below is a js fiddle with the code I have used.

Demo

For some strange reason.. It's not working in the fiddle even though I have copied over the code.. anyway, is there a way that inside the Choose Track: field i can get it to display the chosen track? Thanks.

Upvotes: 0

Views: 91

Answers (1)

Travesty3
Travesty3

Reputation: 14469

Just do this: (jsFiddle)

$('.fileinput').change(function() {
    $('.fileInputMask').text($(this).val());
});

Upvotes: 2

Related Questions