<?
function vehMake($key) {
$sql = 'SELECT * FROM vehicles WHERE vehYear = {$key}';
// $dbserver = mysql_connect("localhost","user","password");
// $query = mysql_query($sql) or die (mysql_error());
$string = '<select name="vehMake" id="vehMakeID" onChange="xajax_vehModel(this.value); document.vehicles.vehModel.style.display=\'block\';">';
$string .= '<option value="none">Please choose vehicle make</option>';
$string .= '<option value="Chevy">Chevy</option>'; // remove this line
$string .= '<option value="Ford">Ford</option>'; // remove this line
$string .= '<option value="Nissan">Nissan</option>'; // remove this line
// while ($row = mysql_fetch_assoc($query)) {
// $string .= '<option value="' . $row['vehMake'] . '">' . $row['vehMake'] . '</option>';
// }
$string .= '</select>';
$objResponse = new xajaxResponse();
$objResponse->assign("selVehMake","innerHTML",$string);
return $objResponse;
}
function vehModel($key) {
$sql = 'SELECT * FROM vehicles WHERE vehMake = {$key}';
// $dbserver = mysql_connect("localhost","user","password");
// $query = mysql_query($sql) or die (mysql_error());
$string = '<select name="vehModel" id="vehModelID">';
$string .= '<option value="none">Please choose vehicle model</option>';
$string .= '<option value="Sedan">Sedan</option>'; // remove this line
$string .= '<option value="Sport">Sport</option>'; // remove this line
$string .= '<option value="Convertible">Convertible</option>'; // remove this line
// while ($row = mysql_fetch_assoc($query)) {
// $string .= '<option value="' . $row['vehModel'] . '">' . $row['vehModel'] . '</option>';
// }
$string .= '</select>';
$objResponse = new xajaxResponse();
$objResponse->assign("selVehModel","innerHTML",$string);
return $objResponse;
}
?>