[Javascript] problem with parent
Allard Schripsema
allard-schripsema at procergs.rs.gov.br
Fri Sep 3 09:56:29 CDT 2004
Your form in "out" is called form1, not form2
try
parent.frame2.form1.texte.value=document.form1.select[i].value;
(didn´t test it but seems a "name" problem)
-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu]On Behalf Of Alexis Doublier
Sent: Friday, September 03, 2004 11:53 AM
To: javascript at LaTech.edu
Subject: [Javascript] problem with parent
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>
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
More information about the Javascript
mailing list