使用jqueryui的日期控件

使用該控件要引用js和css樣式表

 <script type="text/javascript" src="js/jquery-ui-1.8.7.custom.min.js"></script>
<link href="css/jquery-ui-1.8.8.custom.css" rel="stylesheet" />
<script type="text/javascript">
if (top.location != self.location) top.location = self.location;
$(function () {
    $.datepicker.regional['zh-CN'] = {
        monthNamesShort: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
        dayNamesMin: ['7', '1', '2', '3', '4', '5', '6'],
        firstDay: 1,
        showMonthAfterYear: true,
        dateFormat: 'yy/mm/dd',
        showOtherMonths: true,
        selectOtherMonths: true,
        changeMonth: true,
        changeYear: true,
        showAnim: ""
    };
    $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
    $("#BIRTHDAY").datepicker();
});
</script>
<input id="BIRTHDAY" maxlength="20" size="20" runat="server" name="ADateStar" />


對它的賦值

$("#BIRTHDAY").val(json.BIRTHDAY);

對它的讀取

 var BIRTHDAY = $("#BIRTHDAY").val() == "" ? "" : $("#BIRTHDAY").val();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章