I'm working on creating an upload button for my website but I'm unable to trigger events based on when the file is selected for the upload. I was under the impression that the .submit function did this but I'm unable to get any results from this. HTML
<input type="button" id="uploadbutton" value="Upload File" />
<form action="includes/uploader.php" method="POST" id="fileupload_form">
<input id="fileupload" type="file" name="files[]" multiple style="display:none;">
<input id="server" type="hidden" name="server" value="upload">
<input type="hidden" id="storeA" value="statement_upload" name="storeA">
</form>
Javascript/jQuery
var fileupload = $("#fileupload");
$("#uploadbutton").click( function(){
fileupload.click();
});
$("#fileupload_form").submit( function(e){}
This javascript function will not run when trying to select the file and no errors are given. Any and all help is appreciated!
Listen on fileupload.on('change', function(){})
to get what and when was chosen in file selector.