Monday, August 3, 2009

Re: Check boxes for a noob

Is this line 12?

<form method="post" action="<?php echo
$html->url('/admin/users/edit/'.$this->data['User']['id']); ?>">

If yes, then check that you are providing a valid user id! The error
message clearly states that line 12 is in error, and that the 'id' is
not a known index in some array! Therefore, is the above line 12?

The rest is up to you, enjoy,
John

On Aug 2, 1:46 pm, Michael Gaiser <mjgai...@gmail.com> wrote:
> So I am trying to get these check boxes to populate correctly and save to
> the DB. (The Select window is too prone to messing things up). Any ideas why
> the check boxes arnt bring checked properly? Also when I change it to just a
> normal select list ('multiple'='true') I still get this:
>
> *Notice* (8): Undefined index:  id [*APP\views\users\admin_edit.ctp*, line *12*]
>
> I would be grateful for any help.
>
> ~Michael
>
[snip]
>
> The View:
> <h2>Edit User Record (Admin Mode)</h2>
>
> <form method="post" action="<?php echo
> $html->url('/admin/users/edit/'.$this->data['User']['id']); ?>">
>     <?php echo $form->hidden('User.id'); ?>
>
>     <?php echo $form->label('User.username'); ?>
>     <?php echo $form->error('User.username'); ?>
>     <?php echo $form->text('User.username', array('size' => '80' ) ); ?>
>
>     <?php echo $form->label('User.Group', 'User Group (listed according to
> access rights)' ); ?>
>     <?php echo $form->error('User.Group', 'You must select a user group');
> ?>
[snip]
>     <?php echo $form->submit('Save Changes'); ?>
> </form>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

No comments: