bonjour,

j'ai creer un fichier html qui se remplit avec les données d'un xml.

mais les couleurs sont quand à elles renseignées à l'aide d'une fonction javascript que j'ai nommée couleur().

voici ce que j'ai fait

-----------------------------------------------------------------

[code]
<html>
<head>
<title>Historique</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="historique.css" type="text/css">
<xml id="dsoversion" src="data.xml"></xml>
<Script language=javascript>
function couleur (coul, nomDuChamp)
{
document.form.val.style.backgroundColor = coul;
document.form.getElementById(val).value = nomDuChamp;
}
</script>

</head>
<body>
<FORM NAME="form">
<table align=center border=1 class="table-ligne1" width=100% cellpadding=0 datasrc="#dsoversion" datafld="Entete">
<tr class="table-ligne1" width=100% cellpadding=0>
<td width=50%>Historique de la machine :</td>
<td width=50%><span datafld="Champ4"></span>
</td>
</tr>
<tr><td colspan=9>
<table align=center border=0 class="table-ligne2" width=100% cellpadding=0 datasrc="#dsoversion" datafld="Entete">
<tr>
<td width=10%><span datafld="Champ1"></span>
<td width=10%><span datafld="champ2"></span>
<td width=10%><span datafld="Champ3"></span>
<td width=17%><span datafld="champ5"></span>
<td width=17%><span datafld="champ6"></span>
<td width=17%><span datafld="champ7"></span>
<td width=17%><span datafld="champ8"></span>
<td><span datafld="champ9"></span>
</td>
</tr>
</table>
</td></tr>
<tr><td colspan=9>
<table align=center border=0 class="table-ligne2" width=100% cellpadding=0 datasrc="#dsoversion" datafld="Data">
<tr>

<td width=10%><span datafld="Champ1"></span>
<td width=10%><span datafld="champ2"></span>
<td width=10%><span datafld="Champ3"></span>
<td width=17%><span datafld="champ5"></span>
<td width=17%><span datafld="champ6"></span>
<td width=17%><input type="text" id="val" name="val" border="0" value="" onChange="couleur(<span datafld='champ4'></span>,<span datafld='champ9'></span>)"><span datafld ='champ7'></span><!-- <span datafld='champ4'></span>,<span datafld='champ9'></span> -->
<td width=17%><span datafld="champ8"></span>
<td><span datafld="champ9"></span>
</td>
</tr>
</table>
</td></tr>
</table>
</form>
</body>
</html>


[\code]
-----------------------------------------------------------------

je ne comprends pas pourquoi ma fonction couleur ne marche pas????