Foros del Web » Programando para Internet » Javascript »

eliminar ROW

Estas en el tema de eliminar ROW en el foro de Javascript en Foros del Web. hola gente. tengo este escript :) con el cual puedo agregar una fila y un valor.. pruebenlo esta bueno pero me gustaria al descheckear (esta ...
  #1 (permalink)  
Antiguo 21/07/2003, 14:43
Avatar de dieguicho  
Fecha de Ingreso: noviembre-2001
Ubicación: Buenos Aires
Mensajes: 1.190
Antigüedad: 22 años, 5 meses
Puntos: 1
eliminar ROW

hola gente.
tengo este escript :) con el cual puedo agregar una fila y un valor.. pruebenlo esta bueno

pero me gustaria al descheckear (esta bien dicho?) se elimine la celda. va el script, saludos!!!!!!!!!!!

Código PHP:
<SCRIPT LANGUAGE="JavaScript">
function 
addRow(newlabel){
if (
document.form1.nuevocampo.value == ''){
    
    
alert('Enter the label for this area.');
    
document.form1.nuevocampo.focus();
    return(
false);
}
    var 
tbody document.getElementById("myTable").getElementsByTagName("TBODY")[0];
    var 
row document.createElement("TR")
    var 
td1 document.createElement("TD")
    
td1.appendChild(document.createElement("<input type='checkbox' name='chk1' value='1' checked>"))
    var 
td2 document.createElement("TD")
    
td2.appendChild (document.createTextNode(newlabel))
    
row.appendChild(td1);
    
row.appendChild(td2);
    
tbody.appendChild(row);
    
document.form1.nuevocampo.value='';
}
</script>
<table id="myTable" cellspacing="2" border="0" cellpadding="2">
  <tbody> 
  
  </tbody>
</table>
<form name="form1" method="post" action="">
  <table border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td>
        <input type="text" name="nuevocampo">
      </td>
      <td>
        <input type="button" name="Button" value="agregar" onClick="javascript:addRow(document.form1.nuevocampo.value)">
      </td>
    </tr>
  </table>
</form> 
__________________
On error no hago nada porque deje de fumar...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:25.