Hi, I have the following code, what I want to do is submit that form when an option is selected, is there some way I can do this?
My reasoning for this is that I wish to populate another select box depending on what this one is.
<?php
//Code to display the region select box from the DB
include("include-mysql.php");
$query = "SELECT regionName from Region ORDER BY regionName ASC";
$result = mysql_query($query) or die(mysql_error().'<p>'.$query.'</p>');
$i = 0;
echo '<form name="RegSel" method="get" action="register.php"><select name="Region">';
while ($row = mysql_fetch_array($result)) {
echo '<option value="'.$row['regionName'].'">'.$row['regionName'].'</option>';
$i++;
}
?>
<?php
//Code to display the region select box from the DB
include("include-mysql.php");
$query = "SELECT regionName from Region ORDER BY regionName ASC";
$result = mysql_query($query) or die(mysql_error().'<p>'.$query.'</p>');
$i = 0; ?>
<form name="myform1" method="get" action="register.php"><select onChange="myform1.submit();" name="Region"> <?php
while ($row = mysql_fetch_array($result)) {
echo '<option value="'.$row['regionName'].'">'.$row['regionName'].'</option>';
$i++;
}
echo '</select></form>';
?>