Tuesday, August 17, 2010

Save moltiple fields at once

Hello!

I have a settings table and I want to edit all fields on one page and
save them all with one click. Table structure and sample html are
listed below.
How can I create a form in CakePHP? $form->input seems to work with
only a single element, and I don't know how to loop through all
elements and create multiple inputs.

Thanks!

CREATE TABLE IF NOT EXISTS `settings` (
`id` int(11) NOT NULL,
`field` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL
);

<table>
<tr>
<th>Field 1:</th>
<td><input value="Value 1"></td>
</tr>
<tr>
<th>Field 2:</th>
<td><input value="Value 2"></td>
</tr>
<tr>
<th>Field 3:</th>
<td><input value="Value 3"></td>
</tr>
</table>

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate