hh168
(Hanhao12)
1
代码如下,我加载了两个日期控件选项,但是在运行的时候发现只有第一个可以正常使用,点击第二个文本框没有反应,请指教,谢谢!!
<div class="row">
<?php echo $form->labelEx($model,'start_time'); ?>
<?php //echo $form->textField($model,'start_time'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'attribute' => 'start_time',
'model'=>$model,
'name'=>'date',
'options' => array(
'showAnim' => 'fold',
'dateFormat' => 'yy-mm-dd',
),
));
?>
<?php echo $form->error($model,'start_time'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'end_time'); ?>
<?php //echo $form->textField($model,'end_time'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'attribute' => 'end_time',
'model'=>$model,
'name'=>'date',
'options' => array(
'showAnim' => 'fold',
'dateFormat' => 'yy-mm-dd',
),
));
?>
<?php echo $form->error($model,'end_time'); ?>
</div>
hh168
(Hanhao12)
3
脚本两个都是一样的,而且是一个可行,另一个点击后没有反应
clhqk
(cuileon)
7
<div class="simple">
<?php echo $form->label($model,'from_time'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'language'=>'zh',
'attribute'=>'from_time',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
),
));?>
</div>
<div class="simple">
<?php echo $form->label($model,'back_time'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'language'=>'zh',
'attribute'=>'back_time',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
),
));?>
</div>
我这样写是没问题的,可以一次使用两个日期控件!
xiaohan
(Xiaohan2012)
9
<div class="row">
<?php echo $form->labelEx($model, 'start_time'); ?>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker',
array(
'model' => $model,
'attribute' => 'start_time',
)
);
?>
<?php echo $form->error($model, 'start_time'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model, 'deadline'); ?>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker',
array(
'model' => $model,
'attribute' => 'deadline',
)
);
?>
<?php echo $form->error($model, 'deadline'); ?>
</div>
我也没做多的修改,直接用也可以。要不调试下js?看看报的是什么错?
xiyi2008
(Xiyi Pp)
10
很简单的一个问题,两个 name 都 是 date 所以 代码不知道你还有第二个,名字不能同一个,OK
hh168
(Hanhao12)
13
问题追加:
这个日期空间两边的按钮点击后只能调整月份,要是直接调整年可以吗?如何处理代码? 谢谢
jy02511876
(Mf02511876)
14
Options里添加 ‘changYear’=>true,