Passer une valeur d'un input button
Bonjour, je n'arrive pas à passer la valeur de mon input type="button" sélectionné à un 2eme fichier PHP en POST.
Voici le code du fichier contenant les inputs : (j'utilise boostrap pour le CSS du site)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <form class="well" action="formulairetest.php" method="post" name="promotion">
<div class="btn-group" data-toggle="buttons-radio" name="radio">
<input type="button" id="radio1" name="radio" value="Homme" class="btn btn-primary">
<input type="button" id="radio2" name="radio" value="Femme" class="btn btn-primary"/>
<input type="button" id="radio3" name="radio" value="Tous" class="btn btn-primary"/>
</div>
<SCRIPT language="javascript">
$('.btn.btn-primary.active').val();
</SCRIPT>
<input class="btn btn-primary" type="submit" value="Valider">
</form> |
et le code du 2eme fichier PHP :
Code:
1 2 3 4 5 6 7 8 9
|
if(isset($_POST['radio'])){
$valeur_radios = (array)$_POST['radio'];
foreach($valeur_radios as $v){
echo $v;
}
}else{
echo 'fail';
} |
Merci d'avance