Noob here, trying to populate text boxes on a form based on a droplist selection.
I have the droplist working, and now I'd like to take the result of the droplist selection and use it as the basis of querying additional data. I've searched, and see that this may be possible via an OnChange event (Javascript), or re-loading the form. I can't get either to work, however, so looking for a bit of help.
The base code for the droplist is below:
<?php
$connect = mysql_connect($hostname, $user, $pass) or
DIE ("Unable to connect to the database. Please logout and log back in.");
$db = mysql_select_db($database, $connect) or
DIE ("CNPF Pro Sheet Database is not accessible! Please contact the system administrator!");
// The SQL command.
$sql = "SELECT salpha, sname FROM ship WHERE sactive='1' ORDER BY salpha";
$result = mysql_query($sql) or
DIE ("Database query problem!");
?>
<font size=-2>Shipper/Origin:<br><select name="p_pshipper" size="1" style="width:auto" SIZE=40 MAXLENGTH=75 TABINDEX="8">
<?php
WHILE ($row = mysql_fetch_array($result)) {
ECHO "<option>".$row["sname"]."</option>";}
mysql_close($connect);
?>
Thanks in advance for any help. BTW-- Not using a code editor (PC @ work) so sorry in advance for the mess...