Hi I want to use the CJuiDatePicker widget in my _form.php,…but the problem is that it will add new textfield.how do I change the date_from of my form when I am going to click on it the datepicker will show.
Thank you in advance.
<?php
?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'transaction-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>false,
));
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'date_from',
// additional javascript options for the date picker plugin
'options'=>array(
'showAnim'=>'fold',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'date_from'); ?>
<?php echo $form->textField($model,'date_from'); ?>
<?php echo $form->error($model,'date_from'); ?>
</div>
etc......
<?php $this->endWidget(); ?>
</div><!-- form -->