Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Ajax Validation In Fancybox - Wrong Action

$
0
0
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:

$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?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>