Is posible to submit multipart/form-data without refresh page in jQuery?

Posted by bugbug on Stack Overflow See other posts from Stack Overflow or by bugbug
Published on 2010-03-16T08:42:49Z Indexed on 2010/03/16 8:46 UTC
Read the original article Hit count: 187

Filed under:
|

I want to upload picture from "my_form" in jQuery, I tried submit() function it alway redirect to SavePicture.jsp. Is posible to sumbit this form without refresh any page?

This is my html code

<form action="SavePicture.jsp" method="post" id="my_form" enctype="multipart/form-data">
<input name="file" type="file" id="file" size="35">
<input type="button" onClick="upload()" value="upload"></input>
</form>

And my script

function upload{
   jQuery("form#my_form").submit();
}

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about submit