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 41 42 43 44 45 46 47 48 49
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page de test</title>
<script type="text/javascript">
function choice_select()
{
var myselect = document.getElementById("choix_nbr");
var nbre_comment = myselect.options[myselect.selectedIndex].value;
if (nbre_comment == 2)
{
alert("Vous avez choisi 2014 (2)");
// ici je voudrais appeler ma page affich.php et lui passer la variable nbre_comment pour la requête
// et afficher le résultat de ma page affich.php en dessous de la liste déroulante
}
if (nbre_comment == 3)
{
alert("Vous avez choisi 2015 (3)");
// ici je voudrais appeler ma page affich.php et lui passer la variable nbre_comment pour la requête
// et afficher le résultat de ma page affich.php en dessous de la liste déroulante
}
}
</script>
</head>
<body>
<br></br>
Choix :
<div style="padding-right: 350px;">
<select id="choix_nbr" name="nbe_comment" onchange="choice_select();">
<option value="1" name="cmt1">1</option>
<option value="2" name="cmt2">2</option>
<option value="3" name="cmt3">3</option>
</select>
</div>
<br></br>
AFFICHAGE DE RESULTAT :<br></br>
<!--
Afficher le résultat de ma page affich.php
-->
</body>
</html> |
Partager