六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 120|回复: 0

jQuery日历组件

[复制链接]

升级  32%

4

主题

4

主题

4

主题

童生

Rank: 1

积分
16
 楼主| 发表于 2013-1-24 07:17:28 | 显示全部楼层 |阅读模式
jsp界面
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>弹出日历组件演示</title><link href="date/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="date/jquery1-5-2.js"></script><script type="text/javascript" src="date/jquery-ui-1.8.7.custom-core.min.js"></script><script type="text/javascript" src="date/jquery.ui.datepicker.js"></script><script type="text/javascript" src="date/jquery.ui.widget.js"></script><script type="text/javascript">$(function() { $.datepicker.setDefaults($.datepicker.regional['zh-CN']); $('.datepicker').each(function(i){         $(this).datepicker({           inline: true,           dateFormat: 'yy-mm-dd',           showButtonPanel: false          });         $(this).attr("readOnly","true");       });});//日期校验function checkDate(beginStartDate,beginEndDate) {           if(null==beginStartDate || beginStartDate.length==0) {            return true;           }           if(null==beginEndDate || beginEndDate.length==0){           return true;           }           return beginStartDate<=beginEndDate;      }    function checkformDate() {                  //获取页面的时间           var beginStartDate = document.getElementById("start").value;           var beginEndDate= document.getElementById("end").value;           if(!checkDate(beginStartDate,beginEndDate)) {         alert("时间条件:结束日期必须大于开始日期!");         return false;           }           return true;       }</script></head><body><input type="text" id="start" class="datepicker" readonly="true" /> 至<input type="text" id="end" class="datepicker" readonly="true" /><br /><input type="button"  value="校验" /></body></html>  
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表