|
Adding onchange code
Hi Everyone,
I would like to add this code in the script bellow "ONCHANGE="search.value=this.options[this.selectedIndex].text"
I'm not sure how to handle this, can someone help me?
Thanks
<?PHP
@ $db = mysql_pconnect(localhost, xxxx_xxxx, xxx);
if (!$db) {
print "Failed to connect to the database. Please try again later.\n";
exit;
}
mysql_select_db(xxx_xxx);
$sql = "SELECT * FROM `seedling` ORDER BY `Available_Images` ASC";
if (!(@ $result = mysql_query($sql))) {
print "There was an error running your query:<p>\n". $sql . "<p>\n";
}
print '<select name="Available_Images"><br>\n';
print '<option value=""> Choose One ';
while ($row = mysql_fetch_row($result)) {
$id = $row[0];
$Available_Images = $row[24];
print "<option value=\"$id\"";
if ($_REQUEST["Available_Images"] == $id) { print " selected"; }
print "> $Available_Images <br>\n";
}
print '</select>';
?>
|