开发者

how to submit html form in jquery ui modal dialog itself

I am using jquery ui dialog box to display a form.When i click on submit, I want the form to perform action in the same div which is used to display the dialog box. But after form submission the response just displays the retur开发者_JAVA百科ned page on the parent window and not within the dialog.


When your form posts, the entire page is refreshed, not just the containing div element. What you need to do is use ajax form submissions and have the server return only the updated div content. Start here. The success ajax handler would then replace the div content with the server's response.

Edit: If you cannot upgrade to ajax forms or modify the response to include only the DIV content, the immediate alternative would be to host the form content in an iframe within the div. This would cause the form post to update itself within the iframe and not affect the containing page / div element.


Sounds like you want to use $.get() to do an ajax hit to load some new data or html that you can then fill into the dialog box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜