Question

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();
}
Was it helpful?

Solution

OTHER TIPS

You could try the JQuery form plugin, or to see the progress of uploads Uploadify (requires flash)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top