Ciao a tutti ,buon lunedì a tutti!!!
Vi posto questo script che cambia lo sfondo in una input text all'onfocus, e il tutto funziona ,come vedete, con l'identificazione degli campi tramite id.
Come posso farla funzionare non identificando i capi dall'id ma dal nome effettivo che nel caso per es. è "x"

<html>
<head>
<script type="text/javascript">
function changeColor(color,iden)
{
document.getElementById(iden).style.background=col or
}
</script>
</head>

</head>

<body>



This example demonstrates how to change the background color of an input field.</p>


Mouse over the three colored table cells, and the input field will change background-color:</p>

<table width="100%"><tr>

</tr></table>

<form>
<input type="text" id="x" name="pippo" onfocus="changeColor('aqua',this.id)" onBlur="changeColor('white',this.id)" size="20">
<input type="text" id="y" name="pippo" onfocus="changeColor('aqua',this.id)" onBlur="changeColor('white',this.id)" size="20">
<input type="text" id="z" name="pippo" onfocus="changeColor('aqua',this.id)" onBlur="changeColor('white',this.id)" size="20">
</form>

</body>
</html>