http://expert.csdn.net/Expert/TopicView1.asp?id=1264734  // JS  日历控件

解决方案 »

  1.   

    能不能不用日期控件?直接用javascript脚本来判断?
      

  2.   

    <input onblur='if(!/^\d{8}$/.test(value))select()'>
    or
    <script>
    function strDate(str){
    var reg = /^(\d{4})(\d{2})(\d{2})$/; 
    var r = str.match(reg); 
    if(r==null)return false; 
    var d= new Date(r[1], --r[2],r[3]); 
    if(d.getFullYear()!=r[1])return false;
    if(d.getMonth()!=r[2])return false;
    if(d.getDate()!=r[3])return false;
    return true
    }
    alert(strDate("20020131"))
    alert(strDate("20020231"))
    alert(strDate("20020141"))
    </script>