Tema: tabla + DOM
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/06/2008, 14:45
anion0x
 
Fecha de Ingreso: junio-2008
Mensajes: 110
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: tabla + DOM

lo estoy intentando hacer con innerHTML, pero tampoco me anda. Aca pongo el codigo:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>sin título</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="generator" content="Geany 0.14" />
	<script type="text/javascript">
	/*<![CDATA[*/
	
	var c=0;
	function addIdioma()
	{
				
		string = "<tr><th><label for=\"idiomas\">Idiomas</label></th>";
	
		string += "<td><input type=\"text\" name=\"idiomas\"" + c + " id=\"idiomas\" /></td>";      
  
		string += "<th><label for=\"domIdioma\">% de dominio</label></th>" ;
	
		string +=  "<td><input class=\"short\" type=\"text\" name=\"domIdioma\"" + c + "id=\"domIdioma\" />";
 
		string += "</tr>";		

		c++;

		document.getElementById("tabla").innerHTML = string;
	}
	/*]]>*/
	</script>
</head>

<body>

<form action="session4.php" method="get"  name="f1">
<table id="tabla">
              <tr>
                <th><label for="idiomas">Idiomas</label></th>
                <td><input type="text" name="idiomas" id="idiomas" value="" /></td>
                <th><label for="domIdioma">% de dominio</label></th>
                <td><input class="short" type="text" name="domIdioma" id="domIdioma" value="" /> <a href="#" onClick="addIdioma(); return false;">[+] Agregar</a>
			  </tr>
</table>

<?php
	foreach($_GET as $key => $value) {
		echo "<br>$key => $value";		
	}

?>
<input type="submit" value="enviar">
</form>	
</body>
</html>