Hi I’m having trouble adding fields to a form and retrieving them in the controller.
I can easily add fields to a form on button click which is what using:
$('#addButton').click(function()
{
$('#EBASTab').append($('<tr><td>Hello</td><td><input style="height:' + 10 + 'px; width:' + 100 + 'px;"></input></td></tr>'));
but when I try retrieve the forms data using:
$value = $this->request->data;
The field I added to the bottom of the table doesn’t get taken in.
Any idea how I can add the fields to my cakephp form?
Thanks in advance.
There’s no name attribute, that’s why not in post data. Add a
name="data[Model][field]"attribute to the input.