php - jquery: Moving items from one list to another and collect multiple data from that list -
i have 2 select control in html form.
<form name="frmmultiple" id="frmmultiple" method="get" action="movingitemsfromlist.php"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <th align="left" valign="top">select:</th> <th> </th> <th align="left" valign="top">selected:</th> </tr> <tr> <td align="left" valign="top"> <select id="cbocountryid" name="cbocountryid" multiple="multiple" style="width:200px;" size="10"> <option value="1">afghanistan</option> <option value="3">america</option> <option value="3">albania</option> <option value="4">algeria</option> <option value="5">american samoa</option> </select> </td> <td align="center" valign="middle"> <input type="button" id="btnmoveright" name="btnmoveright" value=">>" /> <input type="button" id="btnmoveleft" name="btnmoveleft" value="<<" /> </td> <td align="left" valign="top"> <select id="cbocountryidselected" name="cbocountryidselected" multiple="multiple" style="width:200px;" size="10"> </select> </td> </tr> <tr><td colspan="2"><input type="submit" id="btnsubmit" name="btnsubmit" value="show" /></td></tr> </table> </form> i can move data 1 select control/combo box using jquery:
$(document).ready(function(){ $('#cbocountryid').dblclick(function(){return !$('#cbocountryid option:selected').appendto('#cbocountryidselected');}); $('#btnmoveright').click(function(){return !$('#cbocountryid option:selected').appendto('#cbocountryidselected');}); $('#cbocountryidselected').dblclick(function(){return !$('#cbocountryidselected option:selected').appendto('#cbocountryid');}); $('#btnmoveleft').click(function(){return !$('#cbocountryidselected option:selected').appendto('#cbocountryid');}); }); problem is, want collect data second select control/combo box using php. if use [] in control name, stops moving data. can kindly give me solution?
make sure change name, not id cbocountryidselected[]
<select id="cbocountryidselected" name="cbocountryidselected[]" multiple="multiple" style="width:200px;" size="10"></select>
Comments
Post a Comment