Reputation: 3264
I need to display the file name after choose the file from file input on a HTML page(<input type=file>
).I am using Ruby on rails(Probably it doesn't matter).Pls give me some hint
Upvotes: 0
Views: 1702
Reputation: 18568
$('input[type="file"]').change(function(){
var file_name = $(this).val();
});
check the fiddle : http://jsfiddle.net/cGVCB/
Upvotes: 4
Reputation: 1012
I don't know Ruby, but i'm shure you can use Javascript / jQuery:
alert($('#idOfYourUploadField').val());
Combine it with a change listener, or something, to get it on every change.
Upvotes: 0