Ajax調用我寫的代碼,日期選擇器之前:datepicker打開後,第二次點擊ajax調用?如何在第一次點擊時打開它?
<script type="text/javascript">
$(function() {
$("#birthdate").focus(function() {
$(this).datepicker().datepicker("show")
});
});
$(function() {
$("#joindate").focus(function() {
$(this).datepicker().datepicker("show")
});
});
</script>
此功能onfocus事件後調用:
<tr>
<td align="left">
<input type="text" id="birthdate" name="birthdate" onfocus="$('#birthdate').datepicker({changeMonth: true,changeYear: true,dateFormat: 'dd/mm/yy',defaultDate: '-20y -1m -247d',yearRange: '-50:+0'});" tabindex="14" style="width:300px; " value="<? if($get_emp!='0')echo $employee_birth; ?>" /><span style="color:#F00;">*</span></td>
<td>
<input type="text" name="joindate" id="joindate" onfocus="$('#joindate').datepicker({changeMonth: true,changeYear: true,dateFormat: 'dd/mm/yy',defaultDate: '-3y -1m -247d',yearRange: '-50:+0'});" tabindex="15" style="width:300px; " value="<? if($get_emp!='0')echo $employee_join; ?>"/><span style="color:#F00;">*</span>
</td>
</tr>
Ajax調用後我調用相同的代碼,但它不是第一次點擊打開,但它打開第二次點擊? 請幫我解決這個問題..........................