DatePicker submit date onselect

when selected I want to send the date to the same page with a new parameter with the date value


<?php

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

    'name'=>'publishDate',

    'flat'=>'true',

    // additional javascript options for the date picker plugin

    'options'=>array(

        'showAnim'=>'fold',

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

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

    if(date != "") { 

      window.location.href = "'#here where I don't know what to do#'" ;

    } 

   }',

    ),

    'htmlOptions'=>array(

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

    ),

 

                               

));

?>

I couldn’t find a better solution,


<?php

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

    'name'=>'publishDate',

    'flat'=>'true',

    // additional javascript options for the date picker plugin

    'options'=>array(

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

        'showAnim'=>'fold',

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

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

    if(date != "") { 

      window.location.href = "'.CHtml::encode($this->createUrl('shiftType/view'

              ,array('id'=>$model->id))).'/date/"+date ;

    } 

   }',

    ),

    'htmlOptions'=>array(

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

    ),

 

                               

));

?>