Form has no properties in Netscape 7

Discussion in 'Javascript' started by Terri I., Jan 8, 2004.

  1. Terri I.

    Terri I. Guest

    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);
    }
     
    Terri I., Jan 8, 2004
    #1
    1. Advertising

  2. On 8 Jan 2004 13:27:44 -0800, Terri I. <> wrote:

    <snip>
    > 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

    --
    Michael Winter
    d (replace ".invalid" with ".uk" to reply)
     
    Michael Winter, Jan 9, 2004
    #2
    1. Advertising

  3. Terri I.

    Terri I. Guest

    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 <> wrote in message news:<>...
    > On 8 Jan 2004 13:27:44 -0800, Terri I. <> wrote:
    >
    > <snip>
    > > 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
     
    Terri I., Jan 13, 2004
    #3
  4. Terri I.

    Lee Guest

    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>
     
    Lee, Jan 13, 2004
    #4
  5. Terri I. wrote:

    > 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
     
    Thomas 'PointedEars' Lahn, Feb 4, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    514
  2. Mickey Segal
    Replies:
    1
    Views:
    691
    Mickey Segal
    May 21, 2004
  3. TS
    Replies:
    3
    Views:
    369
    =?Utf-8?B?VFM=?=
    Oct 6, 2006
  4. yaktipper
    Replies:
    10
    Views:
    304
    Richard Cornford
    Jul 10, 2003
  5. Replies:
    2
    Views:
    113
Loading...

Share This Page