I can get value of select field by
Teacher &mdash; <?=$this->data['Quest']['prof_id']?>
but how to get array?
The form contains <?=$form->select("prof_id",$profs,null,array("style"
=> "width:80%"))?>
The table where form data is stored has prof_id. The $profs comes from
another table where id and name (fio) is stored.

controller code is
function quest_new(){
                $this->fastNav['/student/quest/'] = "ques";
                $this->fastNav['/student/quest_new/'] = "new ques";
                if ($this->data){
                        $this->data['Quest']['student_id'] = 
$this->user['student']['id'];
                        $this->data['Quest']['read'] = 0;
                        $this->data['Quest']['is_stud'] = 1;
                        if ($this->Quest->save($this->data)){
                                $this->set("done",true);
                                // add and send email to me
                                $contacts = $this->Contact->find("first");
                                $this->Email->from = "[email protected]";
                                //$this->Email->replyTo = 
$this->user['student']['mail'];
                                $this->Email->sendAs = "html";
                                $this->Email->subject = "new question";
                                $this->Email->template = "question_to_prof";
                                $this->Email->to = "[email protected]";
                                $this->Email->send();
                                //
                        }
                }
                $this->set("profs",$this->Prof->find("list",array("order" =>
"fio","fields" => "fio")));

        }

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to