jQueryUI对话框和表单处理

问题描述

| 我已经搜索并找到了几乎可以正常工作的东西,但是我似乎找不到确切的答案,所以这里... 使用此代码我有一个jQueryUI模态窗口,显示...
<script> 
jQuery(function() {
$( \"#dialog\" ).dialog({ cloSEOnescape: true,modal: true,draggable: false,resizable: false,width: 500,height: 500,close: function(event,ui) { location.href = \'http://www.page.com\' } });
});
</script> 
<div id=\"dialog\" title=\"WELCOME!\">
<form id=\"wp_signup_form\" action=\"\" method=\"post\">
<label>Email address</label><br />
<input type=\"text\" name=\"email\" class=\"text\" value=\"\" /> <br />
<input type=\"submit\" id=\"submitbtn\" name=\"submit\" value=\"SignUp\" />
</form>
</div> 
但是,当我单击表单上的提交时,整个页面将重新加载到模式窗口中。 如何只获取模态窗口以重新加载其中的表单内容(以及在此工作后将添加的一些PHP),还是重新加载整个页面? 谢谢! 克里斯     

解决方法

        我通过在模态窗口中加载iFrame来解决此问题:
 $(document).ready(function() {
        $(\"#modalIframeId\").attr(\"src\",\"http://site.com/wordpress/wp-content/themes/theme/registration.php\");
       $(\"#divId\").dialog({
               autoOpen: true,modal: true,closeOnEscape: true,draggable: false,resizable: false,dialogClass: \'no-close\',height: 500,width: 500,title: \'Sign Up\'
           });
    });
      </script>

    <div id=\"divId\" title=\"Dialog Title\">
        <iframe id=\"modalIframeId\" width=\"100%\" height=\"100%\"
        marginWidth=\"0\" marginHeight=\"0\" frameBorder=\"0\" scrolling=\"none\"
        title=\"Dialog Title\">Your browser does not suppr</iframe>
    </div>
并在iframe中调用registration.php,这是我需要的形式。 谢谢!