<tr> <td>抄送人:</td> <td style="text-align: left;"> <input id="ccIds" name="ccIds" value="" type="hidden"/> <select id="billCcIds" name="billCcIds" class="easyui-combobox" style="width: 100%; height: 28px; line-height: 24px;" data-options="panelHeight: '200', editable: false, multiple: true"> <c:forEach items="${staffList}" var="staff"> <option value="${staff.staffId}">${staff.staffName}</option> </c:forEach> </select> </td> </tr>
$(function() { if('${bxd.ccIds}' != ''){ $('#billCcIds').combobox('setValues', '${bxd.ccIds}'.split(',')); }else{ $('#billCcIds').combobox('clear'); } });
后台String接收 var billCcIds = $("#billCcIds").combobox("getValues"); var arr = []; if(billCcIds != null && billCcIds.length > 0){ for(var i = 0; i < billCcIds.length; i++){ arr[i] = billCcIds[i]; } } $("#ccIds").val(arr.join(","));