⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Set_relation storing ID not actual value



Ron
  • profile picture
  • Member

Posted 04 April 2014 - 16:44 PM

When I use the set_relation for a dropdown, it stores the ID value of that record. How do I get the actual value of the dropdown being stored?

 

 

$crud->set_relation('Destination','Destination', '{Destination} ({City} {State})');

 

 

Thank you.


Amit Shah
  • profile picture
  • Member

Posted 06 April 2014 - 05:23 AM

well there are 2 ways,.. 1 is... create a custom dropdown.. using field_type to enum with array of values to use.

Second way if you plan to store the value --- u can do a callback before insert and retrieve the  value and store it in...

 

which ever way u like it.. u can go with it. 

 

Happy GCing:)


Ron
  • profile picture
  • Member

Posted 07 April 2014 - 12:21 PM

Thank you.