Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/09/2005, 15:54
Avatar de davidangel
davidangel
 
Fecha de Ingreso: abril-2005
Mensajes: 124
Antigüedad: 19 años
Puntos: 0
mira nose si esto es lo q quieres pero chequealo

<html><head>
<script language="JavaScript">
var i=1;
var reto;
function A()
{
var t=document.getElementById('cont').innerHTML;
//t=t.substring(0,(t.length-8));
reto = "table_" ;
//t+="<tr><td><input type='text' value="+i+">"+i+",1</td><td>"+i+",2</td><td>"+i+",3</td><tr></table>";
t+="<table border='1'>";
t+="<form id='fomr" +i+ "'>";
t+="<tr><td>";
t+="<input name='button" +i+ "' type='button' onClick='AddRowsToTable(data,"+i+");return false;' value='+'>";
t+="<table border=1 id='table_" +i+ "'></table>";
t+="</td></tr></form>";
t+="</table>";

document.getElementById('cont').innerHTML=t;
i++;
}
var data = "<input type='text' name='numdoc[]' id='numdoc' class='txtBoxStyle' size='10'><a hre='#' onClick='DeleteRow(this)'> <img src='SIGDOC/ICONOS/SUBMIT.GIF' border='0'></a><input type='radio' name='cierto' id='cierto'>";

function AddRowsToTable(code,n) //no necesario pero en caso de que quieras agregar otra cosa
{
var tbl = document.getElementById('table_'+n);
var lastRow = tbl.rows.length;
var row = tbl.insertRow(lastRow);
var cellRight = row.insertCell(0);
cellRight.innerHTML=code;
//alert(code);
//alert(n);
}

function DeleteRow(x)
{
while (x.tagName.toLowerCase() !='tr')
{
if(x.parentElement)
x=x.parentElement;
else if(x.parentNode)
x=x.parentNode;
else
return;
}

var rowNum=x.rowIndex;

while (x.tagName.toLowerCase() !='table')
{
if(x.parentElement)
x=x.parentElement;
else if(x.parentNode)
x=x.parentNode;
else
return;
}
x.deleteRow(rowNum);
}

function RemoveRowFromTable(rowid) {
//alert("sadfs");
var tbl = document.getElementById(iteration);
//var lastRow = tbl.rows.length;
//if (lastRow > 1)
tbl.deleteRow(rowid);
}


function este()
{
elem=document.all?document.all.numdoc:document.get ElementById('numdoc');

if(elem.length){
elem[elem.length-1].focus();
}else{
elem.focus();
}
}
</script></head><body>
<input type="button" name="af" value="Añadir Form" onClick="A();">
<div id="cont">
</div>
</body></html>

bueno suerte nos vemos