[Javascript] problem with parent
Alexis Doublier
alexis at 2000ecoles.net
Fri Sep 3 09:52:51 CDT 2004
Hi,
I trye to display an information from a select object of a first frame
to a text input object of a seccond frame. so in my script of the first
frame i use this:
parent.frame2.form.text.value=MyValue
But javaconsol return to me this error:
parent.frame2 has no property
Some one have an idea of the mystake?
thanks a lot.
Alexis
My source:
index.html:
<html>
<frameset col="50%,*">
<frame name="frame1" src="in.html">
<frame name="frame2" src="out.html">
</frameset>
</html>
in.html:
<html>
<script LANGUAGE="JavaScript">
function getIn(){
var i;
i=document.form1.select.selectedIndex;
parent.frame2.form2.texte.value=document.form.select[i].value;
}
</script>
<body>
<form name="form1" method="post" >
<select name="select" size="1" onchange=getIn() >
<option value="value1">option1</option>
<option value="value2">option2</option>
<option value="value3">option3</option>
</select>
</form>
</body>
</html>
out.html:
<html>
<body>
<form name=form1 method="post">
<input type="texte" name="texte" />
</form>
</body>
</html>
More information about the Javascript
mailing list