Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/12/2012, 13:26
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 17 años, 8 meses
Puntos: 1567
Respuesta: Necesito limpiar un campo en javascript

no entiendo muy bien a que llamás "proceso", pero más o menos

asumiendo que tu marco superior se llama arriba y tu marco inferior abajo

en arriba.html
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin t&iacute;tulo</title>
  5. <script type="text/javascript">
  6. function valorAbajo(){
  7. var codigo = document.getElementById('c').value;
  8. parent.abajo.alerta(codigo);
  9. document.getElementById('c').value ='';
  10. }
  11. </head>
  12.  
  13. <form action="#">
  14. <input type="text" id="c" />
  15. <input type="button" onclick="valorAbajo()" value="procesar"/>
  16. </form>
  17. </body>
  18.  
  19. </html>

y en abajo.html
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin t&iacute;tulo</title>
  5. </head>
  6. <script type="text/javascript">
  7. function alerta(cod){
  8. alert(cod);
  9. }
  10. abajo
  11. </body>
  12. </html>

Es decir, la función de abajo recibe valores y es llamada desde la función definida en el marco superior con
Código Javascript:
Ver original
  1. parent.abajo.alerta(codigo);

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.