HTML input text box vs CakePHP Automagic Form Elements
Posted
by kwokwai
on Stack Overflow
See other posts from Stack Overflow
or by kwokwai
Published on 2010-05-13T06:31:32Z
Indexed on
2010/05/13
6:34 UTC
Read the original article
Hit count: 225
cakephp
Hi all,
I was manually creating a simple form with one input text box field like this:
<form action="/user/add" method="post">
<input type="text" name="data[user_id]" value="1">
But when I call $this->model->save($this->data)
in the Controller,
nothing was saved to the Table.
Only when I used this and the data in the field was written to the database successfully:
$form->create(null, array('url' => '/user/add'));
echo $form->input('user_id', array('label' => 'User ID', 'value' => '1'));
© Stack Overflow or respective owner