I have an HTML form that sends over the file to be uploaded in php via a form submission. I would rather not change the page when clicking submit and do a bunch of other functions. What is the simplest way of doing that with AJAX?
<form action="upload.php" method="post" enctype="multipart/form-data">
<label style="font-size:18px; font-weight:bold; padding-right:10px"> Select MP3 or WAV file to upload:</label>
<input type="file" name="fileToUpload" id="fileToUpload" style="background-color:lightgrey">
<input style="float:right;margin-right:10px" type="submit" value="Upload File" name="submit" onsubmit="return validateForm()">
</form>