gtrennert
(Gtrennert)
1
Hello,
I have a dropdownlist and dependant of the value selected I would like to update some value.
For starting I have this in my view :
<?php echo CHtml::dropDownList($employee, '', $employeelist,
array(
'ajax' => array(
'type'=>'POST',
'url'=>$this->createUrl('planning/dynamicledgers'),
'update'=>'#test'
)));
?>
...
<div id="test"></div>
In my controller :
public function actionDynamicledgers()
{
echo 'test';
}
I get my dropdownlist but when selecting an item I get this error on the console :
Uncaught Error: Syntax error, unrecognized expression: #
I can’t see where this comes from - Could somebody help me ?
alirz23
(Ali Raza)
2
where is your $employeelist also paste the full stack dump/error
gtrennert
(Gtrennert)
3
These is all what I found on the console :
Uncaught Error: Syntax error, unrecognized expression: # jquery.js:4680
Sizzle.error jquery.js:4680
tokenize jquery.js:4741
select jquery.js:5113
select jquery.js:5289
Sizzle jquery.js:3937
jQuery.event.dispatch jquery.js:3024
elemData.handle.eventHandle jquery.js:2676
And the employeelist comes from the main controller action
public function actionEditAbsence()
{
$this->layout='column1';
$employees = Employee::model()->findAll('enabled=true');
if (!$employees) {
Yii::app()->user->setFlash('error', Yii::t('app','app.error.noemployee'));
$this->render('/site/index');
exit;
}
$employeelist = CHtml::listData($employees, 'id', 'fullname');
if(isset($_POST['save'])) {
}
$this->render(
'editAbsence',
array(
'employeelist'=>$employeelist
));
}
gtrennert
(Gtrennert)
4
There is no other error except the one on the console (nothing in logs)