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 50 51 52 53 54 55 56 57 58 59
|
<html lang="fr">
<script language="javascript">
function changer2(){
var idCourant = document.form.champs.value;
// création de l'objet xhr
if (window.XMLHttpRequest)
xhr = new XMLHttpRequest();
else if (window.ActiveXObject)
xhr = new ActiveXObject("Microsoft.XMLHTTP");
// codage de la réponse
xhr = createRequestObject();
xhr.open('POST', 'test.php', true);
xhr.onreadystatechange = handleAJAXReturn;
xhr.send(null);
if (xhr.readyState == 4)
{
if (xhr.status == 200)
{
//appel de la page test.php en luis passant l' "idCourant" en
//parmaètre?
}
else
{
}
}
</script>
<body>
<form name="form">
<table>
<tr>
<td>Liste des Id Pays : </td>
<td>
<SELECT name="ListId" size="1" onChange="changer2();">
<?php
require 'connect.php';
$req = $pdo->query('SELECT codePays FROM pays;');
$rep = $req->fetchAll();
foreach($rep as $row){
echo '<option>'.$row['codePays'].'</option>';
}
?>
</SELECT>
</td>
<td>Libelle du pays : </td>
<td>
<input type="text" name="champs">
</td>
</tr>
</table>
</form>
</body>
</html> |
Partager