PC Posted April 7, 2009 Share Posted April 7, 2009 I have the following code for populating a combo box: echo "<td>City Search:</td>"; echo "<td><select Name=A_City>"; for($i=0;$i<=$nbcities;$i++) { echo "<option value=".$cityset[CITY_ID][$i].">".$cityset[CITY_NAME][$i]."</option>\n"; echo "</select>"; Unfortunately the first city is correct but the second and subsequent ones aren't in the list but on the screen to the right and therefore not selectable. Can anyone advise where I am goig wrong please? Thanks Paul Link to comment https://forums.phpfreaks.com/topic/153026-solved-combo-box-problem/ Share on other sites More sharing options...
Fruct0se Posted April 7, 2009 Share Posted April 7, 2009 echo "<td>City Search:</td>"; echo '<td><select Name="A_City">'; for($i=0;$i<=$nbcities;$i++) { echo '<option value="'.$cityset[CITY_ID][$i].'">'.$cityset[CITY_NAME][$i]."</option>\n"; } echo "</select>"; Link to comment https://forums.phpfreaks.com/topic/153026-solved-combo-box-problem/#findComment-803721 Share on other sites More sharing options...
PC Posted April 7, 2009 Author Share Posted April 7, 2009 Thanks for your quick response. Worked a treat except that it passes the position in the box rather than the city_id value. Any ideas? Thanks Link to comment https://forums.phpfreaks.com/topic/153026-solved-combo-box-problem/#findComment-803728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.