JavaScript - COMO GENERAR CAMPOS DE FORM DINAMICAMENTE

 
Vista:
sin imagen de perfil

COMO GENERAR CAMPOS DE FORM DINAMICAMENTE

Publicado por LST (16 intervenciones) el 03/03/2004 16:29:08
HOLA:
NECESITO SABER COMO GENERAR CAMPOS DE FORM DINAMICAMENTE, es mas o menos asi:

tengo un form html en una tabla html y con unos campos tipo text y checkboxes, al presionar un boton llamado agregar deberia aparecer otra fila de la tabla conteniendo otro conjunto de inputs html como los anteriores y asi tantas veces como se presione agregar.

como lo hago con javascript?

gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:COMO GENERAR CAMPOS DE FORM DINAMICAMENTE

Publicado por Darker4Ever (43 intervenciones) el 03/03/2004 16:41:29
Te recomiendo que utilices DOM aplicado a la tabla para insertar nuevas filas. Y para dar de alta los controles dinamicamente, en cada celda, meter el código fuente de los controles InputBox
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:COMO GENERAR CAMPOS DE FORM DINAMICAMENTE

Publicado por LST (16 intervenciones) el 03/03/2004 18:04:57
HOLA:
SOY yo de nuevo me prias decir como hacer eso, ya que no se ni lo que es DOM, ¿donde hay un tutorial básico?, solo tengo dreamweaver para escribir el código.

gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:COMO GENERAR CAMPOS DE FORM DINAMICAMENTE

Publicado por ShFile (171 intervenciones) el 03/03/2004 20:51:49
Hola...

Te paso un Ejemplo, Espero que te Sirva.

<Script>
function Agregar() {
LineaTr = document.createElement('<TR>');
tbody.appendChild(LineaTr);
LineaTd=document.createElement('<Td Width="50%">');
LineaTr.appendChild(LineaTd);
LineaTd.innerHTML='<input type=checkbox></Td>';
LineaTd=document.createElement('<Td Width="50%">');
LineaTr.appendChild(LineaTd);
LineaTd.innerHTML='<input type=Text Value="ShFile"></Td></Td>';
}
</Script>
<Body>
<Button OnClick="Agregar();">Agregar Linea</Button>
<br>
<TABLE id=Detalle cellSpacing=0 cellPadding=0 border=1 Width="100%">
<TBODY>
</TBODY>
</TABLE>

<Script>
var tbody=Detalle.childNodes[0];
Detalle.appendChild(tbody);
</Script>
</Body>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

ESTO ES LO QUE BUSCABA, GRACIAS

Publicado por LST (16 intervenciones) el 05/03/2004 22:12:33
ESTO ES LO QUE BUSCABA, GRACIAS
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar