You can simply call your form’s submit
method in the onchange
event of your file input.
document.getElementById("file").onchange = function() {
document.getElementById("form").submit();
};
More Related Contents:
- How to read with JavaScript [closed]
- Submit form without page reloading
- Is there a spec that the id of elements should be made global variable?
- Disabling browser print options (headers, footers, margins) from page?
- Double quote in JavaScript string
- Selecting all text in HTML text input when clicked
- Is it possible to trap CORS errors?
- Stop embedded youtube iframe?
- javascript – shuffle HTML list element order
- How to dynamically create ‘@-Keyframe’ CSS animations?
- Infinity Loop Slider Concepts
- Check Ctrl / Shift / Alt keys on ‘click’ event
- Make anchor link go some pixels above where it’s linked to
- Where should I put the CSS and Javascript code in an HTML webpage?
- Change ‘s option and trigger events with JavaScript
- How to format Vuetify data table date column?
- how to block website from loading in iframe?
- How do I save and restore a File object in local storage
- How can I retain the scroll position of a scrollable area when pressing back button?
- How to send variables from one file to another in Javascript? [duplicate]
- How to position a DIV in a specific coordinates?
- Can we use the value of localStorage from other domains?
- Resource interpreted as Script but transferred with MIME type text/plain – for local file
- How best to make a link submit a form
- jQuery DataTables “No Data Available in Table”
- Gaussian Blur onHover Using jQuery
- Show/hide image with JavaScript
- convert HTML ( having Javascript ) to PDF using JavaScript [closed]
- How to disable an input type=text?
- Communicate between two pages / tabs