2014-02-14 95 views
1

對話框打開時,爲什麼無線電的值是空的(其中,i右點擊並檢查元件)我使用的無線電類型形式的jquery對話框,這樣單選按鈕值對話框

<div id="updateDialog" title="Update"> 
    <div class="box-update"> 
     <form id="d-form" action="" method="post"> 
     <div class="group-r"> 
      <label for="employe_status" class="label-r">Status :</label> 
      <div class="ctrl-radio"> 
       <input type="radio" value="New Employee" id="employe_statusradio1" name="employe_status" /> 
      </div> 
      <div class="radio-txt for-w-small">New Employee</div> 
      <div class="ctrl-radio"> 
       <input type="radio" value="Internaly Transitioning Employee" id="employe_statusradio2" name="employe_status" /> 
      </div> 
      <div class="radio-txt">Internally Transitioning Employee</div> 
      <font color="red">*</font> 
     </div> 
     </form> 
    </div> 

,所以當我提交這個表格,沒有發表任何值....任何想法,請。感謝名單

+1

我們不能用你的HTML標記:) –

+0

只是說準備小提琴請 –

+0

http://jsfiddle.net/5h8CV/我有這樣的概念.. ..在小提琴那工作(價值保持存在),但在我的系統價值變得空虛 – user3309434

回答

0

你的代碼的工作:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
    <head> 
     <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script> 
     <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> 
     <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" /> 
    </head> 
    <body> 
     <div id="updateDialog" title="Update"> 
      <div class="box-update"> 
       <form id="d-form" action="" method="post"> 
        <div class="group-r"> 
         <label for="employe_status" class="label-r">Status :</label> 
         <div class="ctrl-radio"> 
          <input type="radio" value="New Employee" id="employe_statusradio1" name="employe_status" checked="checked" /> 
         </div> 
         <div class="radio-txt for-w-small">New Employee</div> 
         <div class="ctrl-radio"> 
          <input type="radio" value="Internaly Transitioning Employee" id="employe_statusradio2" name="employe_status" /> 
         </div> 
         <div class="radio-txt">Internally Transitioning Employee</div> <font color="red">*</font> 

        </div> 
       </form> 
      </div> 
     </div> 
     <button id="update">Update</button> 
    </body> 
    <script type="text/javascript"> 
    $('#update').button().click(function() { 
     $('#updateDialog').dialog('open'); 
     //alert(); 
    }); 

    $('#updateDialog').dialog({ 
     autoOpen: false, 
     buttons: { 
      'Update': function() { 
       bValid = $("#d-form").valid(); 
       if (bValid) { 
        $('#ajaxLoadAni').fadeIn('slow'); 
        $(this).dialog('close'); 
        alert($('#employe_statusradio1').val() + $('#employe_statusradio2').val()); 

       } else { 

       } 
      }, 

       'Cancel': function() { 
       $(this).dialog('close'); 
      } 
     }, 
     width: '800px' 
    }); //end update dialog  
    </script> 
</html>