Changer liste déRnlnt en fnctn d'1 autre PHP

bip -  
Ozimandias Messages postés 505 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
j'aimerais savoir comment faire pour changer automatiquement une liste déroulante en fonction d'une autre liste déroulante EN PHP (tous ceci sur le meme formulaire et la meme page)
voila mon code :


<form name="formulaire" method="post" action="reservation.php" onsubmit="return verifForm()">

...
<tr>
<td>
<strong>Téléphone</strong>: </td>
<td><input maxlength="10" name="tel" size="30" /></td>
</tr>


/* liste déroulate NUMERO 1 */
<tr>
<td> Destination</td>
<td ><select name="destination">
<option value="sey">Seychelles</option>
<option value="nep">Népal</option>
<option value="irl">Irlande</option>
</select></td>
</tr>
/* -----------------------*/




/* --------NUMERO 2------*/
<?php
$destination = $_POST['destination'];
if ($destination='sey')
{
echo '<tr>
<td width="101"> <strong>Hôtel</strong>: </td>
<td width="437"><select name="hotel">
<option value="sey">Seychelles</option>
<option value="nep">Népal</option>
<option value="irl">Irlande</option>
</select></td>
</tr>';
}
else
{
echo '<tr>
<td width="101"> <strong>Hôtel</strong>: </td>
<td width="437"><select name="hotel">
<option value="sey">nfsdf</option>
<option value="nep">fdsf</option>
<option value="irl">fsddfs</option>
</select></td>
</tr>';
}

?>

VOILA DONC EN GROS IL FAUT QUE LA LISTE DEROULANTE NUMERO 2 CHANGE EN FONCTION DE LA 1

merci
A voir également:

1 réponse

Ozimandias Messages postés 505 Date d'inscription   Statut Membre Dernière intervention   46
 
PHP ne suffit pas, il te faut utiliser javascript (ajax) pour mettre à jour ta liste crée par un fichier php.
0