ram1 ram1 - 1 year ago 98
HTML Question

How do I auto-submit an upload form when a file is selected?

I have a simple file upload form. How do I make it submit automatically when a file has been selected? I don't want the user to have to click the Submit button.


You can simply call your form's submit method in the onchange event of your file input.

document.getElementById("file").onchange = function() {