hello yiiers,
please help me to solve my problem,
I have CJuiDatePicker that I use to trigger an action using ajax.
I have read a topic discuss about this , but for me still not success.
here is my view :
echo CHtml::label('Tanggal Terakhir','','');
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'TanggalTerakhir',
// additional javascript options for the date picker plugin
'options'=>array(
'showAnim'=>'fold',
'dateFormat' => 'yy-mm-dd',
),
'htmlOptions'=>array(
'id'=>'TanggalTerakhir',
'style'=>'height:20px;',
'onSelect'=> 'js: function(dateText, inst) {'.
CHtml::ajax(array('type'=>'POST','datatype'=>'html','url'=>array('site/getDetailSibuhar'),
'data'=>array('selDate'=>'js: dateText'),
'success'=>'function(html){
document.getElementById(NoUrutTerakhir).innerHTML = html;
return false; }',)
).
'}',
),
));
echo CHtml::label('Nomor Urut Terakhir','','');
echo CHtml::textField("NoUrutTerakhir","",array('id'=>'NoUrutTerakhir'));
here is my action in controller :
public function actionGetDetailSibuhar(){
$tanggal = $_POST['selDate'];
echo $tanggal;
}
I want if I select a date, the value of the date will parsing to my action an process to get data from database. the data will show in the textField NoUrutTerakhir.
Thanks in advance.