I have a form element that has an onchange listener to trigger an update another element via ajax.
However, I want the ajax post data to include two form elements, not just the one that is in shown below ($data).
I have tried to put the two elements I want to serialize in their own nested form, which does post the values of both elements, but because this new form is nested in the main page form cakephp then ignores these elements when submitting the main page form.
$data = $this->Js->get('#Reviewevent'.$index.'score')->serializeForm(array(
'isForm' => true,
'inline' => true
));
$this->Js->get('#Reviewevent'.$index.'score')->event('change', $this->Js->request(array(
'controller'=>'events',
'action'=>'getEventDescription'
),
array(
'update'=>'#'.$index.'Description',
'async' => true,
'method' => 'post',
'dataExpression'=> true ,
'data'=> $data
)
));