Hi,

Sorry if this is posted in the wrong newsgroup but i've been searching
Google for the past half an hour and my brain has turned to mush!

Can anyone tell me how to reference a form element in a different frame in
Netscape 6 (and less)?

The following works in IE5.5, but not in Netscape 6 or Mozilla.

    parent.main_frame.myform.Number.value = "Hello";

Here are the contents of  my HTML files, just to clarify what I'm on about!?

index.htm
-----------------------------------------------
<html>
<head>
<title>Index</title>
</head>

<frameset cols="347,*">
  <frame name="contents_frame" target="main_frame" src="contents.htm">
  <frame name="main_frame" src="main.htm">
  <noframes>
  <body>
  <p>This page uses frames, but your browser doesn't support them.</p>
  </body>
  </noframes>
</frameset>
</html>


contents.htm
-----------------------------------------------
<html>
<head>
<title>Contents Frame</title>
<base target="main">
</head>

<body>
<script language="JavaScript">

function fnFrameChange() {
 parent.main_frame.myform.Number.value = "Hello";
}

</script>

<input type="button" value="Add" name="Add" onClick="fnFrameChange()">
</body>
</html>


and finally, main.htm
-----------------------------------------------
<html>
<head>
<title>Main Frame</title>
</head>

<body>

<form name="myform">
<input type="text" name="Number" size="20">
</form>

</body>
</html>



Cheers for any help, much appreciated.

--------------------------------------
Dan Williams

Email: [EMAIL PROTECTED]



Reply via email to