Bonjour,
J'ai une liste de contact avec NOM - PRENOM - CATEGORIE. La catégorie est un menu déroulant qui va chercher les valeurs dans une table : Ami(e) - Famille - Professionnel. Je souhaiterai que lorsque l'utilisateur change de catégorie, ma table se mette à jour automatique mais sans bouton SUBMIT. J'ai donc utilisé un Script.
Mon souci est que lorsque je clique, j'ai le message suivant : "Cet objet ne gère pas cette propriété ligne 6".
Ce qui m'étonne si je change mon script, par exemple juste une alert, ça fonctionne !
Je pense que le souci vient de mon PHP. Merci pour votre aide.

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
<html>
<head>
<script>
function test()
{
document.nom.submit();
}
</script>
</head>
<body>
<?php
include("../connexion.php");
include("menu.php");
$sql = "select * from tadherents, tcontacts  where (idmembrep='$vid' and idadherent=idmembref and accepte='oui') or (idmembref='$vid' and idadherent=idmembrep and accepte='oui' )";
$compte="select * from tadherents, tcontacts where (idmembrep='$vid' and idadherent=idmembref and accepte='oui') or (idmembref='$vid' and idadherent=idmembrep and accepte='oui')";
$result = mysql_query($sql); 
$result2=mysql_query($compte);
$vtotal = mysql_num_rows($result2); 
?>
 
<TABLE align=center class="toprow">
<caption><font size=4 color='#006BAC'>Mes contacts<?php if ($vtotal>0){echo "($vtotal)";}?></font>
<TR>
<TD width=100>Nom</TD>
<TD width=100>Prénom</TD>
<TD width=100>Photo</TD>
<TD width=100>Catégorie</TD>
</TR> 
<?php 
while($vligne = mysql_fetch_array($result)) 
{
	$vcategorie = $vligne['idcatp'];
?>
 
 
<TR>
<TD>
<?php 
$SQL = "SELECT * FROM tcategories_contacts";
$res = mysql_query($SQL);
?>
<form name="nom" action="test.php">
<select onclick="test()">
<?php 
while($val=mysql_fetch_array($res))
{
if ($vcategorie==$val['idcategorie_contact'])
	{
	echo "<option selected value=".$val['idcategorie_contact'].">".$val['libcategorie_contact']."</option>\n";
	}
	else
	{
	echo "<option value=".$val['idcategorie_contact'].">".$val['libcategorie_contact']."</option>\n";
	}
}
?>
 
</select>
</form>
</TD>
 
 <?php } ?>
</TR>
 
 
 
 
 
 
</table>
</body>
</html>