在 jQuery 模式对话框内导航
我有一个问题。我正在使用 jQuery 模式对话框 插件来让用户输入一些数据保存在数据库中。我的对话框实际上可以有两种状态,用户可以通过选择对话框内的单选按钮来进行选择。我遇到的问题是,当用户选择单选按钮时,我会丢失对话框中的一些样式。另外,我该如何做到这一点,以便当用户在对话框上保存输入数据时,在对话框关闭后,我想在当前页面上实时加载新数据(用户无需刷新页面即可查看更改)。
有什么想法吗?
I got a question. I'm using the jQuery modal dialog plugin to let user input some data that will be saved in a database. My dialog can actually have two states which users can choose from by selecting a radio button inside the dialog box. The problem I'm having is that I lose some of the styles on my dialog box when the user selects a radio button. Also, how do I make it so that when the user saves the input data on the dialog box, after the dialog has closed, I want to load the new data live on the current page (with without the user having to refresh the page to see the changes).
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如其他人所建议的,您应该为我们的第一个问题提供一些代码。
对于第二个问题,jQuery 模态对话框插件从 DOM 中选取一个 div 并将其转换为模态对话框。因此,模式对话框中可用的所有控件都可以使用普通 jQuery 进行访问。
此外,您还可以指定在模式对话框内单击“确定”或“取消”按钮时要执行的功能。看看这里:http://jqueryui.com/demos/dialog/#option-buttons< /a>
因此,您可以做的是,当单击“确定”按钮时,您的函数将拾取模式对话框上控件内的所有值并将它们分配给当前页面上的控件。
希望这有帮助。
As suggested by the other guys, you should give us some code for your first question.
For your second question, The jQuery Modal Dialog plugin picks up a div from the DOM and converts it to the modal dialog. So all the controls which are available inside the modal dialog can be access with normal jQuery.
Also, you can assign a function to be executed when the OK or Cancel buttons are clicked inside the modal dialog. Have a look here:http://jqueryui.com/demos/dialog/#option-buttons
So what you can do is, when the "OK" button is clicked, your function will pickup all the values which are inside the controls on the modal dialog and assign them to the controls on the current page.
Hope this helps.