jQuery 如何创建 Ajax 弹出表单并提交表单
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2089303/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
howto create an Ajax Popup Form and submit the form
提问by Guido Lemmens 2
I like to request a ajax-popup bij clicking on a link with variable. The popup will show some date requested from the server. After submit the data will be checked on the server and send a responce back. Depending on the responce, new content will be showed in the popup. The user can close the popup afterwards.
我喜欢请求一个 ajax-popup bij 点击带有变量的链接。弹出窗口将显示从服务器请求的一些日期。提交后,数据将在服务器上进行检查并发送回复。根据响应,新内容将显示在弹出窗口中。用户可以在之后关闭弹出窗口。
I have searched a while for a tutorial or example, but i can't find any.
我已经搜索了一段时间的教程或示例,但我找不到任何。
Who can give me an example or suggestion to startup?
谁能给我一个创业的例子或建议?
回答by Peter Loron
Check into the jQuery UI Dialogwidget. It can do what you need. You just put the controls, text, etc into a DIV, and then invoke the method to pop the dialog. Since the code is in a div, you can update it dynamically with the results of ajax calls as needed.
签入jQuery UI 对话框小部件。它可以做你需要的。您只需将控件、文本等放入 DIV,然后调用该方法来弹出对话框。由于代码在一个 div 中,您可以根据需要使用 ajax 调用的结果动态更新它。