I have an Ajax form that I need to submit as soon as the user selects an image. The problem is that the form is not submitting. Please any guidance will be appreciated
--The form ---
<form id="bgimageform" method="post" enctype="multipart/form-data" action="process.php">
<div class="uploadFile timelineUploadBG">
<input type="hidden" name = "bkg" value = "1"/>
<input type="file" name="photoimg" id="bgphotoimg" class="custom-file-input">
</div>
</form>
--- The JS Codes ---
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery.form.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script src="js/jquery.wallform.js"></script>
<script>
$(document).ready(function() {
/* Uploading Profile BackGround Image */
$('body').on('change','#bgphotoimg', function() {
$("#bgimageform").ajaxForm({target:'#timelineBackground'}).submit();
});
});
</script>