AJAX validation for formular loaded via AJAX

Hello,

I have a strange ajax problem at the moment and I don’t know how to solve this. First of all I have a overview (controller/admin) of some items. In this view there is an add-button which opens a fancybox-dialog which loads the create-formular for example. So the create/view/update-actions are loaded via ajax and displayed in this dialog.

Now the problem is that there is no ajax validation in the add/update-formular. FireBug tells me that jquery.yiiactiveform.js and the corresponding script is loaded correctly but there is no functionality in the form. Here a shortened response of the ajax request:


<script type="text/javascript" src="/igvs/.backend/assets/a5c7b7a4/jquery.js"></script>

<script type="text/javascript" src="/igvs/.backend/assets/a5c7b7a4/jquery.yiiactiveform.js"></script>


<h1>Neues Template hinzufügen</h1>


<div class="form">


<form id="page-template-form" action="/igvs/.backend/content/template/create" method="post">

    

    <!-- fields... -->


</form>

</div>


<script type="text/javascript">

/*<![CDATA[*/

$('#page-template-form').yiiactiveform({'attributes':[{'inputID':'Template_title','errorID':'Template_title_em_'},{'inputID':'Template_html','errorID':'Template_html_em_'},{'inputID':'Template_css','errorID':'Template_css_em_'},{'inputID':'Template_comment','errorID':'Template_comment_em_'}],'summaryID':'page-template-form_es_','focus':'#Template_title'});

/*]]>*/

</script>

What’s strange about this: Firebug does report any error, all is okay… In the console I even can call $(’#page-template-form’).yiiactiveform() which returns an array with the form as single element…

I hope someone can help me… :-/

Hm… The Problem is not the script and has nothing to do with the Fancybox dialog. In the admin.php I have a advanced search form and the yiiactiveform-script takes these input fields for validation instead of these of the loaded dialog. I think here is potential for improvement. I will post later some ideas…