2013-05-12 104 views
0

我不得不選擇用戶在表單中籤名。他們可以提交或取消。如果他們點擊提交,然後他們得到這樣的:Jquery對話框表單提交

enter image description here

,如果他們取消他們得到這樣的:

enter image description here

我有個小問題,我並不介意,但會打擾我的上司(這反過來會打擾我-_-)

如果您發現確認對話框的彈出窗口中的[x]不合適,因爲它不在x框中居中,而是位於其外部,並且我不知道爲什麼這可能會發生。

這是我的JQ:

<script> 

$(document).on('submit', "#signinform", function(e) 
{ 
    e.preventDefault(); 
    var href = '<?php echo base_url();?>studentlogin_controller/agree'; 
    $("#dialog-confirm").dialog(
    { 
     resizable: false, 
     draggable: false, 
     height: 310, 
     width: 500, 
     modal: true, 
     buttons: 
     { 
      "Cancel": function() 
      { 
       $(this).dialog("close"); 
      }, 
      "Enter Queue": function() 
      { 
       window.location.href = href; 
      } 
     } 
    }); 
}); 

$(document).on('click', "#Cancel", function(e) 
{ 
    e.preventDefault(); 
    var href = '<?php echo base_url();?>studentlogin_controller/studentlogin'; 
    $("#dialog-noconfirm").dialog(
    { 
     resizable: false, 
     draggable: false, 
     height: 310, 
     width: 500, 
     modal: true, 
     buttons: 
     { 
      "Cancel": function() 
       { 
        $(this).dialog("close"); 
       }, 
        "Go Back": function() 
       { 
        window.location.href = href; 
       } 
     } 
    }); 
}); 

    </script> 

而我的HTML:

<div id="dialog-confirm" title="Please Confirm" style="display: none;"> 
    <ul> 
     <li>By clicking <FONT COLOR="red">"Enter Queue"</FONT> counselors will be notified that you here - please take a seat</li> 
<br> 
     <li>If You click <FONT COLOR="red">"Cancel"</FONT> you will not be inserted into the Student Queue</li> 
    </ul> 
</div> 

<div id="dialog-noconfirm" title="Please Confirm" style="display: none;"> 
    <ul> 
     <li>By clicking <FONT COLOR="red">"Go Back"</FONT> your information will be removed from the current session</li> 
<br> 
     <li>If You click <FONT COLOR="red">"Cancel"</FONT> your information will still be active and you will stay on the current page</li> 
    </ul> 
</div> 

這是我的主題包括和CSS:

<link rel="stylesheet" href="<?php echo base_url(); ?>css/mainstyle.css" type="text/css" /> 
<link rel="stylesheet" href="<?php echo base_url(); ?>css/secondarystyles.css" type="text/css"/> 
<link rel="stylesheet" href="<?php echo base_url(); ?>javascript/themes/smoothness/jquery-ui-1.8.4.custom.css"/> 

<script src="<?php echo base_url(); ?>javascript/js/jquery.js" type="text/javascript"></script> 
<script src="<?php echo base_url(); ?>javascript/js/jquery-ui-1.10.2.custom.js" type="text/javascript"></script> 

,這是谷歌瀏覽器發生。

+0

另外我不能使用jsfiddle,因爲我的一些html也有php。所以希望這是足夠的信息。 – 2013-05-12 13:56:50

+0

你有開發環境鏈接,你可以分享? – karthikr 2013-05-12 13:58:35

回答

0

我不知道爲什麼我沒有檢查這個早期..

遺憾的問題,以便社區,找到了答案使用谷歌瀏覽工具後:

線446 - >margin: 1px;

是造成錯誤......這是jQuery的自定義UI的版本1.8.4我也改在有一些其他的東西,使它看起來更好,我會的(可能做了這個內聯...)抱歉沒有用自己的某種瀏覽器工具深入瞭解這個問題。

1

你可以檢查鉻中的'x'按鈕元素嗎?它看起來像CSS是給它一些填充或保證金

+0

你絕對正確的,只是發佈我的問題的答案。我是一個白癡沒有檢查元素-_- – 2013-05-12 14:04:45

+0

很高興幫助;) – Jackson 2013-05-12 14:08:21