Salut voila je suis pas trés fort en javascript et je bloque sur un truc simple , je veux cree une fonction qui parcour des input dont le name deveraus etre passé en parametre , , voici déja ce que j'ai fait , une fonction simple qui marche mais comment faire? , j'ai essayer avec this ca marche po ?

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
<html>
<head>
<title>Document sans nom</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function test(param){
var x=window.document.form1.toto.length;
alert(x)
for(var i=0;i<x;i++){
alert(window.document.form1.toto[i].value)
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
  <input type="text" name="toto">  <input type="text" name="toto">   <input type="text" name="toto">
  <a href="#" onClick="javascript:test()">tester</a>
  </form>
</body>
</html>
normalment on doit appeler la fonction javascript:test(this) ? et aprés je fé" comment? j'attend vos réponses merci