![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/11/2007, 13:22
|
| | Fecha de Ingreso: octubre-2007 Ubicación: Santiago ,Chile
Mensajes: 146
Antigüedad: 17 años, 3 meses Puntos: 0 | |
Re: retornar valor de popup yo tengo un codigo algo parecido haber si te sirve :D
esta funcion genera una nueva fila donde ira el texto que tienes seleccionado en el pop up
N_str es un string
z es un array
split es una funcion de separacion de string
function addNewRow(N_str){
z= new Array (12);
z= N_str.split("@@") ;
var TABLE = document.getElementById("base"); // aqui se posciona en la tyabla ke tenga el id base
var TROW = document.getElementById("example");// lo mismo para la fila con id example
var content = TROW.getElementsByTagName("td");
var newRow = TABLE.insertRow(-1);
newRow.className = TROW.attributes['class'].value;
insertLOselect(content,newRow,z);
aqui tienes la funcion de insercion , en mi caso insertara el contenido de z[0] yz[1 ] mas un boton
function insertLOselect(content,Trow,z) {
var cnt = 0;
for (; cnt <= content.length - 1; cnt++) {
if (cnt==0) {
str ='<td>'+z[0]+'</td>';}
if (cnt==1) {
str ='<td>'+z[1]+'</td>';}
if (cnt==2) {
str ='<input type="button" class="boton" value="-" onClick="removeLastRow(this)" > ';
}
appendCell(Trow, str);
}
}
y despues esta la funcion que imprime el contenido del vector y el boton en tu pantalla
function appendCell(Trow, txt) {
var newCell = Trow.insertCell(Trow.cells.length);
newCell.innerHTML = txt ;
}
ojala te sirva suerte xau xau :D |