Get AjaxSubmitButton name with $_POST

Hi all

I use an CHtml::ajaxSubmitButton in my view and can’t get buttons name in my controller with $_POST[‘buttonName’].

I just need to know which Button the user has clicked on.

This has to be done in the data container of the buttons $ajaxOptions parameter but I don’t know how to do this if there is also form data that has to be send.

It doesn’t work with:

'data' => "$(this).parents('form').serialize()+'&name=buttonName'"

                    CHtml::ajaxSubmitButton('Button text',


			       array('cache' => false,

				   'type' => 'post',

	                	   'dataType' => 'html',

				   'success' => " do something",

			       array('name' => 'buttonName'));

Did you monitor the XHR yet?

Does it send the POST data?