How to use CJuiDatePicker in my _form ?

Hi I want to use the CJuiDatePicker widget in my _form.php,…but the problem is that it will add new 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.



<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(


	// 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.





    // additional javascript options for the date picker plugin









	<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'); ?>




<?php $this->endWidget(); ?>

</div><!-- form -->

check this :

for detailed explanation

Hi Thank you for the reply…I am confuse… my form has only 5 textfield including date_from,but when I put the script of CJuiDatePicker like I posted above ,it will create a new textfield ,but what I want is to make my date_from textfield to have datepicker.I hope you understand what I mean.

Thank you in advance.

just take this line out

<?php echo $form->textField($model,'date_from'); ?>

and add the widget there that simple


Thank you it works :)