usually you would retrieve the name of the fruit later on by just de-
referencing (table joins) its id
this way you prevent data redundancy

if redundancy is wanted you might want to retrieve the value before
actually saving this->data
or you can remove the integers prior to displaying the dropdown form -
replacing them with the values as well:

value1 => value1
value2 => value2

depending on the specific scenario



On 18 Mai, 21:22, csj16 <chic...@gmail.com> wrote:
> I have 2 tables and models 'Friend' and 'Message'. I have a belongsTo
> association between them, and this is all working fine.
>
> The select box in my form is being populated with the correct field, that's
> perfect, BUT when the form is submitted it saves the ID of that field not
> the name. Which is obvious as its a INTEGAR field.
>
> But I would like to find out if it's at all possible to ALSO save the name
> that shows in the drop down-list. So let's say the drop-down list is
> populated with different types of fruits (apples, oranges, cherries and
> peaches) but when the form is submitted/saved it doesn't save the name of
> the fruit it saves the ID of that field. Is there anyway to also save the
> name of the fruit into the database?
>
> I am new to CakePHP so I am utterly clueless, but would really appreciate
> some help.
> --
> View this message in 
> context:http://old.nabble.com/Save-select-box-value-not-ID-tp28599700p2859970...
> Sent from the CakePHP mailing list archive at Nabble.com.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to