Skip to end of metadata
Go to start of metadata

To implement Combo box also known as drop-down list, you should use <select> tag


<label for="cars">Choose a car:</label>

<select name="cars" id="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

If you want to do something when user select something,

<select onchange="doSomething();" onfocus="this.selectedIndex = -1;">
  <option>A</option>
  <option>B</option>
  <option>C</option>
</select>

In case that you use PHP combined with select above, below example will be helpful.

<?php

$country_list = [
	"LA",
	"USA",
	"AUS",
	"BRA",
	"CAN",
	"CHN",
	"EU",
	"IND",
	"JPN",
	"RUS",
	"SEA",
	"TUR"
];

if (strlen($c)<1) $c="USA";

echo '<label for="c">Choose a region:</label><select name="c" id="c">';
foreach($country_list as $v)
{
	echo "<option value=\"{$v}\">{$v}</option>";
}
echo "</select>";

?>

Below example changes the URL dynamically by the selected country above.

<script>
function changeRegion()
{
	self.location = "<?php echo "{$PHP_SELF}?m={$m}&c="; ?>" + document.getElementById('c').value;
}	
</script><?php

$country_list = [
	"LA",
	"USA",
	"AUS",
	"BRA",
	"CAN",
	"CHN",
	"EU",
	"IND",
	"JPN",
	"RUS",
	"SEA",
	"TUR"
];

if (strlen($c)<1) $c="SEA";

echo '<label for="c">Choose a region:</label><select name="c" id="c" onchange="changeRegion();" onfocus="this.selectedIndex = -1;">';
foreach($country_list as $v)
{
	echo "<option value=\"{$v}\">{$v}</option>";
}
echo "</select>";

?>