Form has no properties in Netscape 7

T

Terri I.

I have an application that uses HTML, JavaScript, and ColdFusion 4.5. It
was originally written for NN 4.75, and I am updating it to work in the newer
browser. The application consists of a number of frames (some embedded within
each other), and for this particular function, I need to pass data between forms
on 2 different frames.
I updated all references to forms to use recommended syntax, i.e.
document.forms.formname, but I am still getting error that the form has no
properties. I added debugging code to view forms associated with the document,
and it shows that there are 0 forms, so somehow the system does not recognize
the form when I try to reference it from the other frame.
Does anybody have any other recommendations on how to deal with the no properties
error or what other causes for this might be??

FYI, here is some of my debugging code to show how I try to reference form:
var numForms = top.DataFrame.PlotBottomFrame.document.forms.length;
alert("Number of forms in PlotBottomFrame is " + numForms);
for (var i=0; i<numForms; i++)
{
alert("In loop - Number of forms in PlotBottomFrame is " + numForms);
alert("Form is " + top.DataFrame.PlotBottomFrame.document.forms.name);
}
 
M

Michael Winter

I updated all references to forms to use recommended syntax, i.e.
document.forms.formname, but I am still getting error that the form has
no
properties. I added debugging code to view forms associated with the
document,
and it shows that there are 0 forms, so somehow the system does not
recognize
the form when I try to reference it from the other frame.
Does anybody have any other recommendations on how to deal with the no
properties
error or what other causes for this might be??
<snip>

Try applying the same syntax to frame accesses so:

top.DataFrame.PlotBottomFrame.document.forms.length

becomes:

top.frames['DataFrame'].frames['PlotBottomFrame'].document.forms.length

or, more reasonably:

var bottomFrame = top.frames['DataFrame'].frames['PlotBottomFrame'];
var numForms = bottomFrame.forms.length;
...

Mike
 
T

Terri I.

I have tried suggestions from both posters, with no success.
The exact same code works fine in Netscape 4.75. It's like Netscape 7
just doesn't recognize the form buried within the embedded frames.
Does anybody else have any other suggestions??

Michael Winter said:
I updated all references to forms to use recommended syntax, i.e.
document.forms.formname, but I am still getting error that the form has
no
properties. I added debugging code to view forms associated with the
document,
and it shows that there are 0 forms, so somehow the system does not
recognize
the form when I try to reference it from the other frame.
Does anybody have any other recommendations on how to deal with the no
properties
error or what other causes for this might be??
<snip>

Try applying the same syntax to frame accesses so:

top.DataFrame.PlotBottomFrame.document.forms.length

becomes:

top.frames['DataFrame'].frames['PlotBottomFrame'].document.forms.length

or, more reasonably:

var bottomFrame = top.frames['DataFrame'].frames['PlotBottomFrame'];
var numForms = bottomFrame.forms.length;
...

Mike
 
L

Lee

Terri I. said:
I have tried suggestions from both posters, with no success.
The exact same code works fine in Netscape 4.75. It's like Netscape 7
just doesn't recognize the form buried within the embedded frames.
Does anybody else have any other suggestions?

In the following example, the left frame accesses a form element's
value from the right frame as:

top.frames['right'].document.forms['myform'].elements['message'].value

Where "right", "myform" and "message" are all NAME attributes.
It works in Netscape 4.75 and 7.1.

I've defined the frame contents in script in order to be able to post
it as a single file. That's not significant to your problem.

<html>
<head>
<script type="text/javascript">
leftFrameHTML="<html><body><form><input type='button' onclick=\""
+"alert(top.frames['right'].document.forms['myform']."
+"elements['message'].value)\" value='test'></form>"
+"</body></html>";
rightFrameHTML="<html><body><form name='myform'><input name='message'"
+" value='Hello, world!'></form></body></html>";
</script>
</head>
<frameset cols="50%,*">
<frame name="left" src="javascript:top.leftFrameHTML">
<frame name="right" src="javascript:top.rightFrameHTML">
</frameset>
</html>
 
T

Thomas 'PointedEars' Lahn

Terri said:
I have tried suggestions from both posters, with no success.
The exact same code works fine in Netscape 4.75. It's like Netscape 7
just doesn't recognize the form buried within the embedded frames.
WFM.

Does anybody else have any other suggestions??

Please show the relevant snippet of your new code

and stop top posting.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top