romio Posted June 2, 2006 Share Posted June 2, 2006 [code]<td valign='top'> <select name="copy1" multiple size='10'> <?php echo $list_countries = "SELECT * FROM languages_main ORDER BY id"; $query_list_countries = mysql_query($list_countries); $num_rows = mysql_num_rows($query_list_countries); while($row = mysql_fetch_array($query_list_countries)) { $id = $row['id']; $country_name = $row['lang_name']; echo "<option value='$id'>$country_name</option>"; } ?> </select></td><td valign='middle' align='center'> <input type="button" name="right" value=">>" onClick="copySelectedOptions(document.forms[0]['copy1'],document.forms[0]['copy2'],false);return false;"><BR><BR> <input type="button" name="right" value="<<" onClick="removeSelectedOptions(document.forms[0]['copy2']); return false;"><BR><BR></td><td> <select name="copy2" multiple size=10></select><br /></td><tr> <td><input type='submit' name='submit' value='Submit'></td></tr>[/code]copy1 has 20 countries listed in it(static), copy2 will the be the second list box which will be filled when a user select a country from copy1, my question is how can I get all the selected item from copy2 in order to insert it into my table? Quote Link to comment https://forums.phpfreaks.com/topic/11017-list-box-mutliple-selection/ Share on other sites More sharing options...
craygo Posted June 2, 2006 Share Posted June 2, 2006 php is a server side script so copy2 will not populate unless you submit your selection to be parsed to the server. in another words you will have to have one list box with the countries in it with a submit button. Once they select the country they hit the submit button the page will reload and the second list box will populate with what you want.Hope that helpsRay Quote Link to comment https://forums.phpfreaks.com/topic/11017-list-box-mutliple-selection/#findComment-41151 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.