$('#person_birthday').datebox();
当调用下面
$('#person_birthday').validatebox('isValid');
时报错:
网页错误详细信息
消息: '$.data(...).options' 为空或不是对象
行: 4586
字符: 1
代码: 0
URI: http://localhost:8080/easyuidemo/jslib/easyui/easyui1.2.4.js出错的easyui处的代码为:
var opts=$.data(_324,"validatebox").options;
这一句。谁能告诉我这是为什么啊。为什么其他的调用这个方法就可以,datebox却不幸呢。

解决方案 »

  1.   


    $('#applyDateStr').datebox( {
    width : 256,
    fit : true,
    formatter : function(date) {
    return date.format('yyyy-MM-dd');  //这里写你的验证
    }
    });
    //applyDateStr 为你的时间控件的id
      

  2.   

    你干嘛用validbox去...
    <script>
    $(document).ready(function(){
    $("#box").datebox({required:true});
    });var test = function() {
    alert($("#box").datebox('isValid'));
    }</script><input id="box" />
    <a href="javascript:test()">test</a>