Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/08/2015, 17:31
KalSmith
 
Fecha de Ingreso: marzo-2014
Mensajes: 56
Antigüedad: 10 años, 1 mes
Puntos: 1
Pasar variable por .getElementById

COmo hago para pasar una variable por Javascrip ? el tema que tengo el siguiente formulario

Código HTML:
 <SCRIPT LANGUAGE="JavaScript">
	function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=1,menubar=0,resizable=0,width=500,height=500,left = 710,top = 290');");
	}
	</script>


<tr valign="baseline">
          <td nowrap="nowrap" align="right">IMAGEN 1:</td>
          <td><input type="text" id="img" name="img1_adop"/><a href="javascript:popUp('subir_imagen.php');">[ Subir imagen ]</a> </td>
        </tr> 
Código PHP:
 echo "<script>
                  window.opener.document.getElementById('img').value = '"
.$imagen2."';
                    alert('Imagen subida correctamente');
                  window.close();
                  </script>"
;
            } 
La idea es pasar variables en img y no un valor fijo

Gracias por su ayuda. !