Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/01/2011, 12:19
Avatar de suta123
suta123
 
Fecha de Ingreso: octubre-2010
Mensajes: 47
Antigüedad: 13 años, 6 meses
Puntos: 0
Ayuda: innerHTML borrar el valor de imputs

tengo este codigo

Código:
<script>
var tFormFieldCount = 1;
function MakeTextInput() {
	document.getElementById('autor').innerHTML += 'Campo' + tFormFieldCount + '  ' +'<input type="text" name="Campo' + tFormFieldCount + '"><br><br>';
        tFormFieldCount++;
    }
</script>

y luego

Código HTML:
<form action="" method="post">      
<div id="autor"></div>
<input type="button" value="Agregar Campo" onClick="MakeTextInput();">
</form> 
el problema es que cuando se agrega otro campo, se borran las valores que el usuario ingreso en los imputs anteriores.

Ayuda, por favor.