Yii 1.x Datepicker And Ajax Call

Hello,

I am trying to pass parameters to a controller with the name value of the date picked. Can someone please point me to the right way to do this. I have indicated the line on the code with HERE

$model=schedule::model();

$this->widget(‘zii.widgets.jui.CJuiDatePicker’, array(

'model' => $model,


'attribute' => 'schedule_time',


	'options' => array(


		),


'htmlOptions' => array(


    'size' => '10',         // textField size


			'ajax' => array(


				'type' => 'POST',


				'date' => $model->schedule_time,


				'url' => $this->createUrl('dispatcher/AjaxDispatcher', array('value'=> '')), // <-- HERE


				'success' =>'function(data) { alert(data) }',


				'processData' => false,


			),


    'maxlength' => '10',    // textField maxlength


			'onChange' => 'get_schedule_date(this)',


),

));

Appreciate any input.

Hi,

onSelect is the callback function there u have to construct href for ajax call. I hope it w ill solve ur problem





$this->widget('zii.widgets.jui.CJuiDatePicker',array(

                                

                                'name'=>'Reservation[check_in_date]',

                                'value' => ($model->check_in_date)?$model->check_in_date:date('m/d/Y'),

                                'options'=>array(

                                     'dateFormat'=>'mm/dd/yy',

                                     'disabled'=>'true',

                                     'showAnim'=>'fold',

                                     //'beforeShowDay' => 'js:$.datepicker.noWeekends',

                                     'onSelect' => 'js:function(selectedDate) {

                                        $("#Reservation_check_out_date").val("04/23/2011");

                                        }',

                                    'minDate'=>'0',

                                    'changeMonth'=>true,

                                    'changeYear'=>true,

                                ),

                                'htmlOptions'=>array(

                                        'style'=>'height:20px;'

                                ),

                        ));

                ?>