Innanzitutto... avere diversi oggetti con lo stesso id č un errore.
Poi se non vuoi passare il numero del pulsante, come fai per sapere che si tratta del quinto ? Setti una proprietā per dirlo ?
E' possibile dire all'evento quale č stato l'oggetto a dargli il fuoco usando this come parametro del pulsante.
Esempio : senza name nč id
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function pippo(unPulsante) {
alert(unPulsante.value);
}
//-->
</script>
</head>
<body>
<input type="button" value="Primo pulsante" onclick="pippo(this)">
<input type="button" value="Secondo pulsante" onclick="pippo(this)">
<input type="button" value="Terzo pulsante" onclick="pippo(this)">
<input type="button" value="Quarto pulsante" onclick="pippo(this)">
<input type="button" value="Quinto pulsante" onclick="pippo(this)">
</body>
</html>