Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inter frame communication problem 1

Status
Not open for further replies.

Uttam

IS-IT--Management
Oct 2, 2000
7
0
0
US
Hello,
I have a problem which I have described below. I used the code from a posting put up by Tom Anderson in tek-tips website - thank you very much for that...

Frame_00 and Frame_01 are sibling frames in another frame.

Frame_00 (GENERATED BY qq.pl) contains:

<HTML><HEAD>
</HEAD><BODY>
<FORM NAME=&quot;form1&quot;><INPUT NAME=&quot;field1&quot; TEXTAREA READONLY VALUE=&quot;Balmoral
Naval Po, Hmas Penguin, NSW&quot;></FORM>
979660880<BR>au979660881</BODY></HTML>

=======
Frame_01 contains:

<HTML>
<HEAD>
<TITLE>Welcome to our site
</TITLE>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

function check_pin() {

document.Classified_form.pin_decode.value = &quot;decoding...&quot;;

var
url_40=&quot;rm.PIN_CODE.value+&quot;&amp;country_code=au&quot;;

parent.Frame_No_00.location.href=url_40;
setTimeout('final_upload()',6000);

}
function final_upload(){

document.Classified_form.pin_decode.value =
parent.Frame_No_00.form1.field1.value;

}

<irrelevant portions snipped off--->

</SCRIPT>
</HEAD>
<BODY>
<FONT color=&quot;#0033CC&quot; FACE=&quot;Times New Roman&quot;>Please enter the following:
<FORM NAME=&quot;Classified_form&quot;>
Your PostCode
<INPUT NAME=&quot;PIN_CODE&quot; TYPE=&quot;text&quot; MAXLENGTH=04 SIZE=04 onBlur=&quot;check_pin()&quot;>
<input size=35 readonly type=text name=pin_decode value=&quot;&quot;>

<irrelevant portions snipped off--->

</FORM>
</TD><TR></TABLE></BODY></HTML>

============
the problem is essentially in inter-frame communication..

what I am trying to accomplish is:

1) accept a post_code in Frame_01 (into the field named PIN_CODE)
2) when focus is lost on the field, fire off a javascript script (check_pin)
which loads Frame_00 with a form whose one (and only) field contains the decode of the post_code.
3) load pin_decode with the value extracted from the field on form in Frame_00.

I get a

JavaScript Error:
line 11:

parent.Frame_No_00.form1 has no properties.

in Netscape although IE works well.

Appreciate your help in that.

Thank you in advance.

Uttam
 
1 - you say your frame is &quot;Frame_00&quot; and then you refer to it as &quot;Frame_No_00&quot; !
2 - netscape<6 is not really ... .... compliant. The correct syntax isn't parent.framename.formname for netscape, but as i'm not sure of the correct syntax, it's better to wait for some ns expert here ;-) ... or to code for ie4+ and ns6+ only :]
 
sorry about the typos...

Correct frame names are Frame_No_00 and Frame_No_01,

Within the code, there is a consistent use of Frame_No_00. And I know that the loading of Frame_No_00 is correctly done, only the extraction in Frame_No_01 from Frame_No_00 is not successfully done...

My problem is essentially with this part:

document.Classified_form.pin_decode.value =
parent
.Frame_No_00.form1.field1.value;


 
try:

document.Classified_form.pin_decode.value =
parent.Frame_No_00.document.form1.field1.value;

as that may work. jared@aauser.com
 
THAT HIT THE SPOT.. THANKS A MILLION JARED!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top