![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/06/2004, 09:00
|
![Avatar de KarlanKas](http://static.forosdelweb.com/customavatars/avatar11549_2.gif) | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes Puntos: 61 | |
Prueba con esto. Sólo lo he probado en IE y va.
` Código HTML: <html>
<head>
<title>Untitled</title>
<script>
numero=0;
function nuevoCampo(){
numero+=1
var Campo = document.createElement("<input type='text' name='elemento"+numero+"' onfocus='if(numero=="+numero+")nuevoCampo()'>");
var salto = document.createElement("<br>");
document.forms[0].insertBefore(Campo);
document.forms[0].insertBefore(salto);
}
</script>
</head>
<body>
<form action="javascript:alert(document.forms[0].elements.length)">
<input type="text" name="elemento0" onfocus="if(numero==0){nuevoCampo()}"><input type="submit"><br>
</form>
</body>
</html> Un saludo!
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |