2012-09-07 21 views
0
$(function(){ 
       // Dialog 
       $('#dialog').dialog({ 
       autoOpen: false, 
       width: 600, 
       buttons: { 
        "Ok": function() { 
         $(this).dialog("close"); 
        }, 
        "Cancel": function() { 
         $(this).dialog("close"); 
        } 
       } 
      }); 

      // Dialog Link 
      $('#dialog_link').click(function(){ 
       $('#dialog').dialog('open'); 
       return false; 
      }); 

      //hover states on the static widgets 
      $('#dialog_link, ul#icons li').hover(
       function() { $(this).addClass('ui-state-hover'); }, 
       function() { $(this).removeClass('ui-state-hover'); } 
      ); 

     }); 

IM使用對話框的jQuery .....這就是問題....jQuery的對話框,並在其中,我想使用日期選擇器 它告訴我outsde對話框的日期選擇器

<div id="dialog" title="Find Patient"> 
     <p> 
     <table style="table-layout: fixed; width: 550px;"> 
     <tr> 
      <td><label class="form-item-label form-item-label-right">Patient Id :</label> </td> 
      <td><input type="text" name="byId" id="byId" style="width: 90%" /></td> 
      <td><a class="button" href="#"><span>Find</span></a></td> 
     </tr> 
     <tr> 
      <td><label class="form-item-label form-item-label-right">Patient`s Name :</label></td> 
      <td><input type="text" name="byName" id="byName" style="width: 90%"/></td> 
      <td><a class="button" href="#"><span>Find</span></a></td> 
     </tr> 
     <tr> 
      <td></td> 
      <td><input type="text" id="dob" name="dob" style="width: 90%"></td> 
      <td><a class="button" href="#"><span>Find</span></a></td> 
     </tr> 
     </table> 
     </p> 
    </div> 

時即時通訊使用日期選擇器Jquery在對話框中的最後一行表格 加載我的HTML頁面Datepicker首先加載頁面

+0

你可以添加你的html代碼嗎? – mattematico

+0

我叫#dob的onfocus datepicker函數。所以日期選擇是來在頁面不在對話框......現在問題.... –

回答

2

我不知道這是你的解決方案,但試試這個,如果你傾向於使用Jquery datepicker你應該直接在加載mabye時將它添加到元素上,而不是在f上無論如何,它會在您關注文本框時追加。注意代碼行$('#dob').datepicker();

$(function() { 
    // Dialog 
    $('#dialog').dialog({ 
     autoOpen: false, 
     width: 600, 
     buttons: { 
      "Ok": function() { 
       $(this).dialog("close"); 
      }, 
      "Cancel": function() { 
       $(this).dialog("close"); 
      } 
     } 
    }); 

    $('#dob').datepicker(); 

    // Dialog Link 
    $('#dialog_link').click(function() { 
     $('#dialog').dialog('open'); 
     return false; 
    }); 

    //hover states on the static widgets 
    $('#dialog_link, ul#icons li').hover(
      function() { $(this).addClass('ui-state-hover'); }, 
      function() { $(this).removeClass('ui-state-hover'); } 
     ); 

}); 
+0

IM使用 \t $(函數(){ \t \t \t \t $( 「#DOB」)日期選擇器(); \t \t \t \t $( 「#DOB」)日期選擇器( 「選項」, 「日期格式」, 'DD-MM-YY'); \t \t \t}); –

+0

這個問題是解決了,但 對話框我已經放了兩個按鈕,確定和取消是 兩個名字沒有在這兩個R工作,但名字沒有顯示該對話框顯示....... –

+0

plz幫助..please給我一個像這樣的jQuery的演示http://www.orthoimplantcompany.com/products/ –

相關問題