mercredi 15 avril 2015

is undefined after simple file select

I have:



<input type="file" name="fileToUpload" id="fileToUpload" />


Clicking the "Choose file" button allows me to select a file using Finder/Explorer/whatever. When I click "Open" and return to my form, the text "No file chosen" remains.


If i check the value using:



$("#fileToUpload").change(function() {
console.log($("#fileToUpload").value);
});


The value is undefined. I am tearing my hair out because this is so, so simple and it's not working. What can I be missing?


Aucun commentaire:

Enregistrer un commentaire