Entry
I have a drop down box populated with names of towns from my db (MySQL). My question is how do I select a town and then go to that page.
Feb 10th, 2004 07:04
Ivars Kalnins, John Clarke,
You need to have your drop-down box redirect to other page when it's
value (selection) changes.
This is done as follows:
<select name="city"
onChange="document.location='city.php?id='+this[this.selectedIndex].value;">
<option value="1">London</option>
<option value="3">Berlin</option>
...
</select>
In the resulting page (city.php) you would read the $_GET['id'] variable
to display the right content.