When the user submits a form how can it submit to an iframe and show a result on the main page?
I'm having a user upload a picture, I'm开发者_JAVA百科 trying to allow them to stay completely on the page when the picture uploads. How can I have the form submit to an iframe or something and upload the picture then return whether it was successful or not?
You don't need an iframe for that, you just need to do an Ajax form submit.
Then on the server side, you can upload it and return whether or not it was successful or not.
http://api.jquery.com/submit/
You might be better off using something like uploadify http://www.uploadify.com/
You can use the target attribute on a form.
<form method="post" action="handler.php" target="my_iframe">
...
</form>
<iframe name="my_iframe"></iframe>
精彩评论