https://jsfiddle.net/yugxqopz/
I'm new to the world of UI and have a simple request:
1) I want to upload a document using an "attach file" option
2) Once the file is selected, I want to automatically trigger a specific JavaScript function as shown below:
<form id="fileUploadForm" onsubmit="return uploadToTempFolder();" enctype="multipart/form-data">
<input type="file" name="file" id="file" accept="application/pdf">
<input type="submit" class="button-blue" value="Upload">
</form>
Instead of having a separate button for uploading, I would like to replace the "choose file" option with "attach file". When the user selects the file, I want the 'uploadToTempFolder' function to be triggered automatically.
Any assistance would be greatly appreciated.
Thanks,
Harry