J'ai un problème dans le code suivant , lorsque je choisis dans ma liste déroulante le choix fonctionne par contre pour les boutons cela ne fonctionne pas
Code : Tout sélectionner
<html>
<form name ='form1' action='attente.php' method='post'>
<?php
$selection1 = $_POST["bouton1"];
if ($selection1 <> null ) {
echo "selection N° 1:";
echo "$selection1";
}
$selection2 = $_POST["bouton2"];
if ($selection2 <> null ) {
echo "selection N° 2:";
echo "$selection2";
}
$liste = $_POST["nom_option"];
if ($liste <> null) {
echo "Selection :" .$_POST["nom_option"];
}
?>
<br> <br>
<input type='button' value='recharge 1' onclick='document.form1.submit()' name='bouton1'>
<br>
<input type="button" value="recharge 2" name="bouton2" onclick="document.form1.submit()">
<br>
<select size='1' name='nom_option' onchange='document.form1.submit()'
<option value="choix1" <?php if($liste=="choix1") echo "selected" ?>>Choix 1
<option value="choix2" <?php if($liste=="choix2") echo "selected" ?>>Choix 2
<option value="choix3" <?php if($liste=="choix3") echo "selected" ?>>Choix 3
</form>
Philippe