cs_bultez
Messages postés13616Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention15 octobre 201330 11 juil. 2005 à 10:26
Bonjour,
une solution : window.document.frm["n"+n]...
j'aurais plutôt mis le même nom
et utilisé : window.document.frm.nm[n]...
ou par ID ? : window.document.getElementById("nom"+n)...
<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript">
function test()
{
for ( var n=1;n<=3;n++ )
alert("frm.n#="+window.document.frm["n"+n].value);
for ( n=0;n<window.document.frm.nm.length;n++ )
alert("frm.n[#]="+window.document.frm.nm[n].value);
n=1;
var tmp=window.document.getElementById("nom"+n);
while (tmp)
{ alert("ById="+tmp.value);
n++;
tmp=window.document.getElementById("nom"+n); }