Hi folks,
Ok, here's what I'd like to try and do.
I have a select box which pulls it's values from a MySQL database for shipping information as follows:
<?
$query = "SELECT * FROM shipto_bchydro ORDER BY id DESC";
$result = mysql_query($query) or die("Select Failed!");
if (mysql_num_rows($result) > 0) {
echo "<select name=\"shipid\" class=\"form\">";
echo "<option value=\"\">Choose Shipto</option>";
while ($hasil = mysql_fetch_array($result)) {
echo "<option value=\"".$hasil['id']."\">".$hasil['address']."</option>";
}
echo "</select>";
}
?>
So, the query will pull "division", "address", "city" and "postalcode" values.
I've created the select box just fine, and what I would like to do is have a function that will change 4 text fields when the user chooses (onchange) a different option from the select box.
So, below that select box will be 4 form fields. User selects "1341 Greenway Ave", and it updates the four text fields to the division/address/city/postalcode of the "1341 Greenway Ave" address.
Is this possible?
P.S. Sorry if this is more of a javascript question. I figured it would fit better here due to the select and data being in PHP.
Cheers,
B