posting form with file upload

Posted by Jan on Stack Overflow See other posts from Stack Overflow or by Jan
Published on 2010-05-27T08:35:33Z Indexed on 2010/05/27 8:41 UTC
Read the original article Hit count: 186

Filed under:
|
|
|

I am having trouble with uploading a file when using jquery.

I have the following HTML in a form. <fieldset> <ul> <li>
<div class="field"><input size="35" type="file" name="formFile" id="formFile"/></div> </li> <li>
<div class="field"><input size="35" type="text" name="formFileName" id="formFileName" /></div> </li> </ul>
</fieldset>

To post the data I am using $('#myForm').ajaxForm(

When I post the data and the recieved data contains some javascript, the javascript is not recognised.

I expected the javscriptcode to run when the data is recieved, but it happens to early. The results indicates that $ or jquery could not be found.

If I remove the name attribute from the input type=file element, there are no errors, but that is not the correct solution.

How could this happen?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery