"multiple selected" on edit is not working , codeigniter

May 30, 2016 260 views

i have two view page , one is add another one is edit , either having same fields
i.e name , color. in color field i am using drop-down list coming from database.
Now , let i am adding name and selecting two or three color from list and then submit the form, result is store in database table name 'color' as, id="1",name="name" and color="["1","2","3"]" here add works fine.

But , when i am trying to edit this id "1", all looks good (id="1", name="name") except select field, select field shows all drop-down list of colors, but check/mark looks only first value of list for every id's . what do i do to get all selected values in select list with check/mark

Be the first one to answer this question.