Jump to content

<select> help


UnknownPlayer

Recommended Posts

I have this form:

<form>
<label>Select Country:</label>
<select name="country" id="country">
	<?php
		$query = "SELECT * FROM countries";
		$result = mysql_query($query, $connection);
		while ($country = mysql_fetch_array($result)) {
			$county_id = $country['id'];
			$county_name = $country['name'];
			echo '<option value="{$county_id}">'.$county_name.'</option>';
		}
	?>
</select>
</form>

 

now i wonna, when someone choose some country, to read from "cities" table all cities which are in choosen country, and to make another <select> for choosing cities.. but without refreshing page.. i mean with js.

Can someone help me, please?

Link to comment
https://forums.phpfreaks.com/topic/223706-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.