Trigger CJuiDatePicker

Hi,

How to Open Datepicker Model popup when Click <i class="fa fa-calendar" id="from_calender"></i>

<?php

            &#036;this-&gt;widget('zii.widgets.jui.CJuiDatePicker', array(


                'name' =&gt; 'from_date', // name of post parameter


                'value' =&gt; Yii::app()-&gt;request-&gt;cookies['from_date'], // value comes from cookie after submittion


                'options' =&gt; array(


                    'onClose' =&gt; 'js:function (selectedDate) { &#036;(&quot;#to_date&quot;).datepicker(&quot;option&quot;, &quot;minDate&quot;, selectedDate); }',


                    'showAnim' =&gt; 'fold',


                    'dateFormat' =&gt; 'dd-mm-yy',


                ),


                'htmlOptions' =&gt; array(


                    'class' =&gt; 'form-control required',

// ‘style’ => ‘height:20px;’

                ),


            ));


            ?&gt;

$("#from_calender").click(function (event)

{


    event.preventDefault();


    &#036;('#from_date').click();


});

It’s not working.

Are you certain that "from_date" is the correct id?

Also these might help you:

http://jqueryui.com/datepicker/#icon-trigger

http://stackoverflow.com/questions/8107013/jquery-datepicker-manual-triggering

Great,Thanks