Je travail dans une petite application J'ai une page php contient seci
tab.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 <?php header("Content-Type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; echo "<list>"; $idEditor = (isset($_POST["IdEditor"])) ? htmlentities($_POST["IdEditor"]) : NULL; if ($idEditor) { include_once 'AccB.php'; $Acc=new AccB(); $re="select * from `enfants` where `NumEnreg`=$idEditor;"; $Exr=$Acc->Select($re); while($Lir=$Exr->fetch()) { echo "<item id='$Lir[0]' NomFamille='$Lir[1]' prenomEnfnat='$Lir[2]' prenomEnfnat='$Lir[3]' Age='$Lir[4]' Fonction='$Lir[5] Tel='$Lir[6] DomicileACtuel='$Lir[8]' Sexe='$Lir[9]' SutuationFamillier='$Lir[10]' Datemariage='$Lir[11]' Photo='$Lir[12]' la9Ab='$Lir[13]' />"; } } echo "</list>"; ?>
et dans la page qui contient la fonction appel tap.php J'ai sa
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 function tab(oSelect) { var value = oSelect.options[oSelect.selectedIndex].value; var xhr = XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) readtab(xhr.responseXML); }; xhr.open("POST", "tab.php", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("IdEditor=" + value); } function readtab(oData) { var nodes = oData.getElementsByTagName("item"); var oSelect = document.getElementById("d"); var oOption, oInner2,otd1,otd2,oInner1; oSelect.innerHTML = ""; for (var i=0, c=nodes.length; i<c; i++) { oOption = document.createElement("tr"); var otd11=document.createElement("td"); var oInner11 = document.createTextNode("id"); var otd12=document.createElement("td"); var oInner12 = document.createTextNode(nodes[i].getAttribute("id")); otd11.appendChild(oInner11); otd12.appendChild(oInner12); oOption.appendChild(otd11); oOption.appendChild(otd12); var otd21=document.createElement("td"); var oInner21 = document.createTextNode("NomFamille"); var otd22=document.createElement("td"); var oInner22 = document.createTextNode(nodes[i].getAttribute("NomFamille")); otd21.appendChild(oInner21); otd22.appendChild(oInner22); oOption.appendChild(otd21); oOption.appendChild(otd22); oSelect.appendChild(oOption); } } //--> </script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <select id="editorsSelect" onchange="request(this);"> <option value="none">Selection</option> <?php include_once 'AccB.php'; $Acc=new AccB(); $re="select * from rue"; $Exr=$Acc->Select($re); while($Lir=$Exr->fetch()) {?> <option value="<?php echo $Lir[0]; ?>"> <?php echo $Lir[1]; ?></option> <?php }?> </select> <select id="softwaresSelect" onchange="requestt(this);"></select> <select id="EnfantsSelect" onchange="tab(this);"></select> <table id="d" border="2"> </table>
tout les fonction request marche a merveille mais la fonction tab marche pas
Cordialement Ryodo
Partager