I'd like to take my form below, and somehow adjust it to submit the form when the user selects a file. How can I do that?
<div id=uploadform style="width:500px;margin-left:auto;margin-right:auto;">
<form enctype="multipart/form-data" action='' method='POST'>
<input type="file" name="imagefile" class=browse>
<input type='submit' value='Upload' class=uploadsubmit onClick="if($('#loading').css('display') == 'none') { $('#loading').show('fast'); $(this).hide('fast'); };">
<input type='hidden' value='1' name='submitted' />
</form>
</div>
<div id=loading style="display:none;">
<img src=uploading.gif>
</div>
Since the button will be absent(ideally), how can I still show my image loading layer after submit?
To clarify, I want the submit button itself gone, and when the user selects a file, submit the form and show the #loading layer.