I placed an ajaxSubmit button on a form, but after the page is loaded the button does nothing.
Why ajaxSubmitButton is not responding? Have any idea
Can I use other Button?
<?php echo CHtml::beginForm(); ?>
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
blahblahblah
)); ?>
<?php echo CHtml::ajaxSubmitButton(‘Delete(s)’, Controller::createUrl(‘DeleteAjax’)); ?>
<?php echo CHtml::endForm(); ?>
Controller
public function actionDeleteAjax()
{
for ($i = 0; $i < sizeof($_POST['delete']); $i++)
{
if ($model = Example::model()->findbyPk($_POST['delete'][$i]))
$model->delete();
}
}