Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  193] [ 5]  / answers: 1 / hits: 158705  / 15 Years ago, sat, april 11, 2009, 12:00:00

From what I've ready you should be able to use the 'value' property of a file input field to get the currently set path of that field. But when I do this:



 $('#fileinput').value()


I get 'undefined'. The ID of the field is set to fileinput I'm sure. Does anyone have any thoughts on why this might not be working for me?



And by the way, this works:



var d = document.getElementById('AttachmentFile');
alert(d.value);


So I guess this has something to do with the way jQuery works that I don't fully understand.



Thanks!


More From » jquery

 Answers
13

You need to use val rather than value.



$(#fileinput).val();

[#99718] Saturday, April 4, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wyattkennyc

Total Points: 650
Total Questions: 102
Total Answers: 90

Location: Monaco
Member since Mon, May 23, 2022
2 Years ago
;