I am trying to populate multi selected data on to the user management form below the name field of the user.
Here is what I have added inside the form, in order to display multi selected data from db.
<field name="groupMember" type="list" description="choose cybertechnos groups" label="Choose Groups" multiple ="true" required="true" size="111" > <option value ="A">A</option> <option value ="B">B</option> <option value ="C">C</option> </field>
In order to populate and convert string coma based value into array, I have added the following code inside:
just after load data by query in
$data variable inside the load function.
$data["groupMember"] = explode(',', $data["groupMember"]);
But when I check my form inside user management panel, I see two problems.
1) It displays the list with tag style rather than multi selected listbox like below picture.
2) It does not display proper selected values which are coming from the database.
This is the wrong style it shows in the user management list, "Choose Group"