No sé , a ver si esto te va
index_iframes.html
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript"> //<![CDATA[
function recibe(valor){
document.getElementById('guarda').innerHTML = valor;
}
function responde(){
alert("El valor del input texto en form.html es: " + document.getElementById('guarda').innerHTML);
}
//]]>
index
<div id="guarda" style="display: none;"></div> <iframe src='form.html' id="iframe_form" name="iframe_form"></iframe><br /> <iframe src='boton.html' id="iframe_boton" name="iframe_boton"></iframe><br />
form.html
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <input type="text" value="" id="texto" onkeyup="parent.recibe(this.value)" />
boton.html
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <button onclick="parent.responde();">obtener valor input text en iframe form
</button>
SAludos