duanlong4890 2013-08-27 20:33
浏览 63

日期选择器选择日期未选择

im having a hard time in inserting the selected date date in date picker when im selecting earlier year the value that inserting to my data base is the current date

heres my code

bdate


<link href="jqueryui/css/smoothness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<script src="jqueryui/js/jquery-1.9.1.js"></script>
<script src="jqueryui/js/jquery-ui-1.10.3.custom.js"></script>
<script>
$(function() {

$( "#datepicker" ).datepicker({

              changeMonth: true,
        changeYear: true,
        yearRange: "-50:-1",
        dateFormat: 'yy-mm-dd',
        defaultDate: '01-01-1950'

        });
        });

</script>
<style>
/*datepicker hack*/
#ui-datepicker-div { font-size: 12px; } 
</style>



<tr>
    <td>Birthday*</td>
    <td><input id="datepicker" name="bdate" <?php if(isset($bdate)){ echo 'value="'.$bdate.'"';}?> /></td>
  </tr>

thanks

  • 写回答

1条回答 默认 最新

  • douweng3564 2013-08-27 20:41
    关注

    The default date is in the wrong format, it should be yy-mm-dd, so you should have it set to 50-01-01.

    Also the earliest year that datepicker will go to is 1963.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line