I have a problem with Ajax validation in Fancybox.
I have an ajaxLink that opens Fancybox with a form. This form should be send via Ajax to controller and validated, but wrong action is used automatically and I can’t change it.
AjaxLink that opens and fills Fancybox is defined in View like this:
I think controller is not important here. Problem is in the ajaxSubmitButton() and using JS by Yii. My controller is empty. It contains only code that is mentioned above. But…
class LinksController extends Controller
{
public function actionTest1()
{
$output = $this->renderPartial('form', array(), true);
echo $output;
Yii::app()->end();
return;
}
public function actionSave()
{
}
}
PS: I think that if I use rednerPartial() (or if I print something in an action - which is the same), Yii doesn’t add some JS code so ajax doesn’t work. Because if I program it by myself (using global JS file, classes and events), everything goes well.