Jump to content


Show selected value using field_type 'dropdown'

dropdown field_type

  • Please log in to reply
1 reply to this topic

#1 vaibhav

vaibhav

    Member

  • Members
  • PipPip
  • 10 posts

Posted 15 November 2012 - 06:50 AM

$crud->field_type('designation','dropdown',
array('1' => 'PHP Developer', '2' => 'Android Developer','3' => 'Web Designer');

I want to show the selected desigation from the table in the dropdown.
i.e
if($value == 'PHP Developer')
then 'selected="selected"';
in the drop down.

Also if i dont select any designation from the drop down , then the designation value is automatically set to null or empty.


Thanks :)

#2 victor

victor

    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 967 posts
  • LocationMinsk

Posted 02 December 2012 - 12:08 AM

You can use the callback_add_field and callback_edit_field.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users