发布表单并获取有关jQuery Dialog本身的数据

时间:2013-11-08 05:51:24

标签: jquery-ui jquery

目前我的项目以这种方式运作

  1. 继续填写表格
  2. 点击按钮新窗口弹出窗口
  3. 在popupwindow中填写数据并提交
  4. 弹出窗口关闭,该窗口上的数据保存到数据库
  5. 继续填写父表单并保存数据
  6. 现在我想用jQuery UI Dialog替换弹出窗口并执行相同的操作 (步骤2 3 4)

    这里有一些代码

     $( "#rtrDialog" ).dialog({  
         autoOpen: false,     
         height: 300,
         modal: true,
         width: 350,  
         buttons: {        
             "Continue..": function() {
                 alert("Button Clicked");
                 var url = "contractDetails.htm";
                 window.open(url, '_blank');
             }
         }
        });
    
    $("#RTRButton").click(function(){
        $("#rtrDialog" ).dialog("open");
    });
    
    
    <!-- This form is used to capture the RTR related Dialogs -->
    
                            <div id="rtrDialog" title="Enter RTR Details">  
                            <form>  
                            <fieldset>    
                            <p><b>Enter Details for ?</b></p>
                            <input type="radio" name="entity" value="applicant"/>Applicant<br/>
                            <input type="radio" name="entity" value="co-app1"/>Co-Applicant 1<br/>
                            <input type="radio" name="entity" value="co-app2" />Co-Applicant 2<br/>
                            <input type="radio" name="entity" value="co-app3" />Co-Applicant 3<br/>
                            <input type="radio" name="entity" value="guarantor1" />Guarantor 1<br/>
                            <input type="radio" name="entity" value="guarantor2" />Guarantor 2<br/>
                            <input type="radio" name="entity" value="guarantor3" />Guarantor 3<br/> 
                            </fieldset>  
                            </form>
                            </div>
    

    我怎么能这样做?

    我是否必须采用jQuery-Ajax方式?或者还有什么比这更好的了

1 个答案:

答案 0 :(得分:0)

Use twitter bootstrap for opening the dialog box and perform your action..
http://getbootstrap.com/2.3.2/javascript.html#modals

check this..
Hope this will help ..