Buenas, resumo rapido, tengo unos input hiden con id= a_i <- i va del 1 al 9, y tengo otros input con id = ai <- i va del 1 al 9, estoy haciendo una funcion que meta los valores del input hidden en los input normales.
Código HTML:
FUNCIONA:
function dame_tropas_total()
{
form1.a1.value = document.getElementById("a_1").value;
}
Código HTML:
NO FUNCIONA:
function dame_tropas_total()
{
for(i=1;i<=9;i++)
{
form1."a"+i.value = document.getElementById("a_"+i).value;
}
}
A ver si alguien me puede ayudar