To simplify your code, you can define var $displayField = 'name' in your
Model, and have everything generated by the generateList(); <-- no params
necessary.

You will need to utilize Javascript on your second question.

On the first selectTag, add 'onChange' => 'javascript:changeSelect();' on
the fourth param. Then create a script (or load from external file)
containing the method changeSelect.

This method should check what is the current value of the first selectTag,
and then modify the second selectTag based on it.

Kinda hard, but when you tried Javascript once, it'll get easier.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of ERic ZoU
Sent: 08 Desember 2006 21:49
To: Cake PHP
Subject: Re: can I use generateList( ) get rather than Id?


Ok. thanks kind buddy in the irc , jacob and kalileo
The first question's solution in already in the API.
$this->set('list',$this->Fenlei->generateList(null, null, null,
'{n}.Fenlei.name', '{n}.Fenlei.name')); 

BUT how is the second one ?




--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to