Problem On Submit Dialog Form With Ajaxsubmitbutton

Using this wiki as an example, I made some simple modifications to make a master detail form.

The behavior is to show all the information (the master detail), and open the dialog to add a detail. To make it simple, the master only has a description field, so too as the details. The dialog is opened without any problem, but do submit, I get the error "400 Bad Request".

Making debug my code I see that the method actionAddNew receives a variable called $_, this first call (when showing the dialog).

And looking at the code generated in the form, the action attribute is set to "index.php?r=property/addNew&idgroup=3&_=somevalue".

But it also generates the following javascript code




[javascript]

/*<![CDATA[*/

jQuery('body').on('click','#closePropiedadDialog',function(){jQuery.ajax({'success':function(data){

					$("#propiedadDialog").dialog("close");

				},'type':'POST','url':'/sac/index.php?r=propiedad/addNew','cache':false,'data':jQuery(this).parents("form").serialize()});return false;});

/*]]>*/



Looking at the error I see that the URL is invoked javascript code, not the form’s action.

My question is, how, when, who creates the variable $_, I guess is a variable created by YII, and not being forwarded to when submit the form gives the error.

If so, how to send that parameter is missing?

Thanks