I have a problem with a jquery form plugin. I am trying to upload a file asynchronously, but it does not submit the form. HTML code and javascript code look below
<form id="fileUploadForm" method="post" action="Default.aspx" enctype="multipart/form-data"> <input type="text" name="filename" /> <input type="file" id="postedFile" name="postedFile" /> <input type="button" value="Submit" onclick="UploadFile();" /> </form> $(document).ready(function() { $('#fileUploadForm').ajaxForm(); }); function UploadFile() { var options = { url:"Default.aspx", beforeSend: ShowRequest, success: SubmitSuccesfull, error:AjaxError }; $("#fileUploadForm").ajaxSubmit(options); return false; }.
I have another test form in which there is only a text box and it works great. Also, when I comment out the input type = "file" ... line, this form also works fine. What is the problem with input type file? Any idea?
jquery plugins forms file-upload
mehmet6parmak
source share