CJuiDatePicker problem

I use CJuiDatePicker for a date but since I fill the date there is the error Date cannot be blank. is here

What is wrong?


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

                'name'=>'date_date','model'=>$model,'attribute'=>'date_date',

                // additional javascript options for the date picker plugin

                'options'=>array(

                        'showAnim'=>'fold',

                ),

                'htmlOptions'=>array(

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

                ),

        ));

You should use model and attribute instead of model and name.

So I have this


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

                'model'=>$model,'attribute'=>'date_date',

                // additional javascript options for the date picker plugin

                'options'=>array(

                        'showAnim'=>'fold',

                ),

                'htmlOptions'=>array(

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

                ),

        ));

But I have at textfield this 07/03/2010 so the insertion at mysql has error 0000-00-00

Ho can I fix it?

[edit] There is ‘dateFormat’=>‘YYYY-m-d’,

use ‘dateFormat’=>‘yy-mm-dd’