Pergunta

I have the same issue that is expressed here: http://ask.cakephp.org/questions/view/multiple_submit_buttons_1

That page asked about the issue, but there was no solution posted that actually worked.

I have a cakephp ajax popup form with multiple buttons. On the back end controller, when I look through the post values, the value of the button is not being sent. This happens in all my ajax forms. It doesn't pass the submit buttons as a form value.

My question is: How can I get the form value of the submit button on the back end controller? I had a solution that worked, but was quirky. I added javascript to each of the submit buttons onclick event that set the value of a hidden input box named "form_action".

Nenhuma solução correta

Outras dicas

Set the name for the button:

echo $this->Form->submit('Reply',array('name'=>'data[Message][reply]'))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top