0

我正在使用 yii 框架开发一个应用程序。我的一种形式还需要一个 yii 客户端验证和 jquery 日期选择器,但是当我启用我的客户端验证时 jquery 日期选择器停止工作。

页面中包含以下 js 文件:

//jquery库

http://code.jquery.com/jquery-latest.js

//用于jquery日期选择器

“http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css” “http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery- ui.min.js"

4

1 回答 1

1

尝试使用 CJuiDatePicker 而不是加载外部 jquery-ui:

$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'model' => $model,
    'attribute' => 'model_date',
    // additional javascript options for the date picker plugin
    'options'=>array(
        'dateFormat' => 'yy-mm-dd',
    ),
    'htmlOptions'=>array(
        'id' => 'foo',
    ),
));
于 2012-05-22T09:10:37.783 回答