1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
<?
// include connexion bdd...
if(isset($_POST['submit'])) {
$query="SELECT code FROM sref WHERE couleur = '".$_POST["couleur"]."'";
$code = mysql_result(mysql_query($query),0);
?>
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function choix_couleur() {
var valeur_select = document.getElementById('couleur').options[document.getElementById('couleur').selectedIndex].value;
}
//-->
</script>
</head>
<html>
<body>
<form name="form" method="post" action="script.php">
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select onChange="choix_couleur()" name="couleur" id="couleur">
<option value="C01">Blanc</option>
<option value="C02">Bleu</option>
<option value="C03">Rouge</option>
</select>
</td>
</tr>
<input type="submit" value="Submit" name="submit">
<input type="hidden" name="code" value="<?=$code?>" />
</table>
</form>
</body>
</html> |