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
|
function go(){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
leselect = xhr.responseText;
document.getElementById('multiprises').innerHTML = leselect;
}
}
xhr.open("POST","index.php",true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
sel = document.getElementById('multiprises');
des_pdt_prises = sel.options[sel.selectedIndex].value;
xhr.send("Des_pdt_prises="+des_pdt_prises);
}
</script>
</head>
<body>
<form>
<fieldset style="width: 500px">
<legend>Liste liées</legend>
<label>reference</label>
<select name='ref' id='ref' onchange='go()'>
<option value='-1'>Aucun</option>
<?
include("connexion.php");
$res = mysql_query("SELECT * FROM multiprises ORDER BY ref_pdt_prises");
while($row = mysql_fetch_assoc($res)){
echo "<option value='".$row["ref_pdt_prises"]."'>".$row["ref_pdt_prises"]."</option>";
}
?>
</select>
<label>designation</label>
<div id='des' style='display:inline'>
<select name='des'>
<option value='-1'>designation</option>
</select>
</div>
</fieldset>
</form> |
Partager