Out of the box, a combobox with multiple selections only saves the last item in the list of selections.
Work around?
onSubmit convert multiple combobox comma-separated integers to a string value
...
onSubmit: function(){
//Convert multiple combobox integer to string value START
var _Invitees = $('#idformInvitees').combobox('getValues');
_StrInvitees = String(_Invitees);
$('#idformInvitees').combobox('setValue', _StrInvitees);
return $(this).form('validate');
...
But reloading still causes problems.
Example:
Here are 3 lookup values in db table for populating the combobox:
ID TEXT
1 Person A
3 Person B
31 Person C
I have selected all three and in my MySQL table they are saved as "1,3,31"
When I reload the comobobox, this is what is displayed as the comma-separated list of selections with unwanted additional commas and has misinterpreted the data:
Person A,,,Person B,,,Person B,Person A
What seems to be happening is that the value is evaluated as a string, all commas are removed and the individual single-digit integers are evaluated as values.
1,3,31 -> 1331 -> "1" "3" "3" "1"
Is there a way of extending the save and load functionality of a combobox to handle multiple selections with integer key fields?