[javascript/php]Recharger une page après choix dans liste déroulante
Bonjour à tous,
J'ai un petit soucis ; en fait je suis entrain de coder une page en php. j'ai une liste de choix et j'aurai aimé qu'en selectionnant une valeur, grace au javascrit ma page courante se recharge avec en parametre la valeur du choix. est ce possible ?
Voici l'extrait du code que j'ai et qui ne marche pas
Code:
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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="./styles.css" rel="stylesheet" type="text/css">
<title>Gestion de document</title>
<script type="text/javascript">
<!--
// Rechargement de la page
fnction loadPage(param) {
window.location='http://localhost/projet bd/gestionDocument.php?RefDOC=param';
}
//-->
</script>
</head>
<body>
...
<form name="form1" method="post" action="">
<label>Choix du document :
<select name="choixDoc" onchange="loadPage('<?php echo $res['Ref']; ?>');">
<?php while ($res = mysql_fetch_array($rep)) { ?>
<option value="<?php echo $res['Ref']; ?>"><?php echo $res['Ref'].' - '.$res['Titre']; ?></option>
<?php } ?>
</select>
</label>
</form>
...
</body>
</html> |
Merci d'avance.