eskio Posted July 17, 2008 Share Posted July 17, 2008 I want to transfer 1 or many items from the first list to the second and save. How can I save the two list boxes at the same time? ??? here is my code: <script language="javascript" type="text/javascript"> function TransferList(l1,l2) { if (l1.options.selectedIndex>=0) { o=new Option(l1.options[l1.options.selectedIndex].text,l1.options[l1.options.selectedIndex].value); l2.options[l2.options.length]=o; l1.options[l1.options.selectedIndex]=null; }else{ alert("Please select a course"); } } </script> <?php if (isset($_POST['cmdSave'])){ } // if (isset($_POST['cmdSave'])) ?> <form name="frmCourse"> <table> <tr> <td align="center"><strong>Courses</strong><br /> <select name="CoursesList1" size=6 style="width:120px"> <option value="C++">C++</option> <option value="VB6">VB6</option> <option value="VB.NET">VB.NET</option> <option value="C#">C#</option> <option value="PHP">PHP</option> <option value="Delphi">Delphi</option> </select> </td> <td align="center"> <input type="button" value="Add >>>" onClick="TransferList(this.form.CoursesList1,this.form.CoursesList2)"> <br /><br /> <input type="button" value="<<< Delete" onClick="TransferList(this.form.CoursesList2,this.form.CoursesList1)"> </td> <td align="center"><strong>Courses</strong><br /> <select name="CoursesList2" size=6 style="width:120px"> </select> </td> </tr> </table> <input name="cmdSave" type="submit" value="Save"> </form> Link to comment https://forums.phpfreaks.com/topic/115230-how-can-i-save-two-list-boxes-at-the-same-time/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.