I am searching for a jQuery script that selects a file when the form is automatic submitted.
Asked
Active
Viewed 9,410 times
5
-
Possible duplicate of [How do I auto-submit an upload form when a file is selected?](https://stackoverflow.com/questions/7321855/how-do-i-auto-submit-an-upload-form-when-a-file-is-selected) – slartidan Feb 25 '19 at 19:06
1 Answers
12
Try .change() event for the input file control. Something like
<form action="test.html" id="form1">
<input type="file" id="fil1" />
</form>
$(function(){
$("#fil1").change(function(){
$("#form1").submit();
});
});

rahul
- 184,426
- 49
- 232
- 263