ram1 ram1 - 10 months ago 81
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() {