How can I detect when a user has chosen which file to upload using a html file input. That way I can submit the form automatically.
+1
A:
The file upload element fires an onchange event when its contents have changed. Here's a very terse example:
<input type="file" name="whatever" onchange="alert('Changed!');" />
EDIT: Oh, and if you'd like to submit the form when they select something (although this will probably be a little confusing to your users):
<input type="file" name="whatever" onchange="this.form.submit();" />
Faisal
2010-07-10 10:44:51
Just noticed that you're using jQuery, in which case you'll want to use the change() event like Reigel suggested.
Faisal
2010-07-11 22:05:37