0

I am working in codeigniter and using dropdown to populate values in select2 jquery dropdown, but the issue is i cannot retain the selected value after form submit, after using det_value it shows id not text. Here is my code:

$name = array('id'=>'name','name'=>'name','class'=>' form-control');
echo form_dropdown($tutor_name,set_value('name'));
Mohit Rathod
  • 1,057
  • 1
  • 19
  • 33
user3653474
  • 3,393
  • 6
  • 49
  • 135

1 Answers1

0

Kindly change the 'name'=>'name' to 'name'=>'tutor_name',

refer this link and change the code according to the format given:

https://codeigniter.com/user_guide/helpers/form_helper.html

Gokul
  • 101
  • 1
  • 5