Hi all.
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:
Action "test1" prints this form which is shown in Fancybox:
But if I click the "save" button, action "test1" is called. Not action "save".
Does anybody know what is wrong?
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:
$ajaxOptions = array(
'success' => "function(data) { $.fancybox({content:data}); } ",
);
echo CHtml::ajaxLink('open', $this->createUrl('links/test1'),$ajaxOptions);Action "test1" prints this form which is shown in Fancybox:
echo CHtml::form($this->createUrl('links/save'));
echo CHtml::textField("mytext", "text");
$ajaxOptions = array(
'url'=>$this->createUrl('links/save'),
);
echo CHtml::ajaxSubmitButton('save',$this->createUrl('links/save'),$ajaxOptions);
echo CHtml::endForm();
But if I click the "save" button, action "test1" is called. Not action "save".
Does anybody know what is wrong?