Can the employee choose another employee id in the select list? If the
employee is not allowed to choose another employee id, then just show
the existing employee id as a label, not a list.
For preselecting the employees id in the select list, add the
employees id to the controllers data variable, example:
[code]
$this->data['Employee']['id'] = $this->Auth->user('employee_id');
[/code]
Replace the respective parts according to your data structures.
Enjoy,
John
On Jan 15, 8:37 pm, Guran <[email protected]> wrote:
> I am building a expense submitter system. I have employees who have a
> "name field" and an "employee_id field".
> In the view - views/expenses/add.ctp Cake has generated the following
> code:
> <?php echo $form->input('employee_id'); ?>. This results in a select/
> option drop down listing all the employees.
> Through a login process I have an employee_id. I would like the field
> employee name to be the name of the current logged in employee that
> will be a part of the submit when I hit the submit button.
> as against the whole list. I have tried various approaches without any
> success. Any help is appreciated.
> thanks
> /guran
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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en