提交表单后的回调函数
我有以下表单:
有没有办法在提交后向表单添加回调函数?基本上我将 upload.php 的结果回显到 iframe,我想做的是使用回调函数获取该信息。
I have the following form :
Is there a way to add a callback function to the form after it is submitted? Basically I am echoing the result of upload.php to an iframe and what I want to do is to get that information using a callback function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您想要使用 Ajax 提交帖子,并让 javascript 捕获结果中的回显并将 HTML 写入 iframe。
You want to use Ajax to submit the post, and have the javascript catch the echo in a result and write out the HTML to the iframe.
正如 Gnostus 所说:使用 Ajax 提交表单,并在 ajax 完成并收到响应时附加一个函数...像这样(javascript)
不要忘记从表单中获取值,做一些事情就像:
并通过 ajax 调用提交它们......
你明白了。
As Gnostus says: use Ajax to submit the form, and attach a function for when the ajax has completed and has received a response... something like this (javascript)
Don't forget to get the values out of your form, do something like:
and submit them with the ajax call...
you get the idea.