public function actionAjaxUpdate()
{
$action = $_GET['act'];
if(!isset($_POST['selectedId']))
{
echo '<script> alert("No row is selected"); </script>';
}
else
{
$selectedAll = $_POST['selectedId'];
if(count($selectedAll)>0)
{
foreach($selectedAll as $selectedId)
{
$model=$this->loadCompositeModel($selectedId);
switch ($action) {
case 'Delete':
$model['account']->delete();
break;
case 'Active':
$model['account']->active = '1';
break;
case 'Inactive':
$model['account']->active = '0';
break;
default:
break;
}
$model['account']->save();
}
}
}
}
- List item
In this code Alert is not working, if no id is selected.So some one help me out. i have tried alot but js is not working. I have used js inside the php and this is the first time when js is not working inside the php
$_POST['selectedId']is