[jQuery] Can't get upload to work with jquery.form.js
Hi, I'm testing the form plugin and can't get the upload to work. It
just submits the page. I really don't know what I'm doing wrong.
Here's my code taken from the demo page.
<form id="uploadForm" action="upload" method="POST"
enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE"
value="100000" />
File: <input type="file" name="file" />
Return Type: <select id="uploadResponseType"
name="mimetype">
<option value="html">html</option>
<option value="json">json</option>
<option value="script">script</option>
</select>
<input type="submit" value="Submit" />
</form>
<script type="text/javascript">
function upload(){
alert('testing');
return false;
}
$(document).ready(function(){
photoUploadForm=$('#uploadForm');
photoUploadForm.ajaxForm();
photoUploadForm.submit(upload);
});
</script>