Frame/form question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dfenestr8

    Frame/form question

    Hi.

    I'm trying to build a page that has two frames, both of which are
    generated by a different cgi script.

    The lower frame is generated by a script called "control.py ".

    The upper frame is generated by a script called "getchat.py ".

    On the lower frame, there is a button called "REFRESH". When clicked, I
    want it to be able to read information in a hidden input on a form in the
    upper frame, that being .....

    <input type=hidden NAME="last_seen " value = "' + str(lastByteLoc ) + '">

    .... and submit that information to getchat.py.

    I have a javascript routine worked out which *usually* does that when I
    view the page with konqueror. Unfortunately it never seems to work with
    mozilla. Can anybody tell me why? And better still, how I can fix it?

    Here's the code generated by control.py ......

    In the <head> i have ....

    <script language = "javascript ">
    <!-- hide from older browsers

    function refreshPosts()
    {
    plast = parent.chatfram e.form1.last_se en.value;
    parent.chatfram e.location = 'getchat.py?las t_seen=' + plast
    }

    //-->
    </script>

    And on the form in the lower frame, I have this input ......

    <input type = "button" value = "REFRESH" onClick = "refreshPosts() ">

    Thanx in advance.

  • kaeli

    #2
    Re: Frame/form question

    In article <pan.2003.11.22 .16.27.34.57479 1@yahoo.com.au> ,
    chrisdewinN0SPA M@yahoo.com.au enlightened us with...[color=blue]
    >
    > function refreshPosts()
    > {
    > plast = parent.chatfram e.form1.last_se en.value;[/color]

    parent.chatfram e is a window object. Form belongs to document.

    plast = parent.chatfram e.document.form 1.last_seen.val ue;

    --
    --
    ~kaeli~
    Do not taunt Happy Fun Ball!



    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: Frame/form question

      kaeli <tiny_one@NOSPA M.comcast.net> writes:
      [color=blue]
      > parent.chatfram e is a window object. Form belongs to document.
      >
      > plast = parent.chatfram e.document.form 1.last_seen.val ue;[/color]

      or better yet (since I prefer to use the appropriate collections :)

      plast = parent.frames['chatframe'].document.forms['form1'].
      elements['last_seen'].value;

      There is no official standard for Javascript access to frames,
      so I can't say that using the frames collection is more official than
      just assuming the frames are direct properties of their parent.

      However, the W3C DOM specification requires the forms collection, and
      there is no requirement that forms are available as properties of the
      document element. That means that a (hypothetical) strictly standards
      adhering browser (implementing nothing unofficial) will only work
      using the forms collection.

      Ditto for the elements collection.

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      • Dfenestr8

        #4
        Re: Frame/form question

        On Sat, 22 Nov 2003 15:25:31 +0000, kaeli wrote:
        [color=blue]
        > In article <pan.2003.11.22 .16.27.34.57479 1@yahoo.com.au> ,
        > chrisdewinN0SPA M@yahoo.com.au enlightened us with...[color=green]
        >>
        >> function refreshPosts()
        >> {
        >> plast = parent.chatfram e.form1.last_se en.value;[/color]
        >
        > parent.chatfram e is a window object. Form belongs to document.
        >
        > plast = parent.chatfram e.document.form 1.last_seen.val ue;[/color]

        Thanx. That does the job.

        Now it works perfectly with mozilla but sometimes breaks when using
        Konqueror. Specifically, when I press REFRESH, but there's nothing new to
        update the chatframe with. After that, REFRESH won't work again until I
        reload the whole page.

        Comment

        • kaeli

          #5
          Re: Frame/form question

          In article <pan.2003.11.23 .06.33.09.11118 0@yahoo.com.au> ,
          chrisdewinN0SPA M@yahoo.com.au enlightened us with...[color=blue]
          >
          > Thanx. That does the job.
          >
          > Now it works perfectly with mozilla but sometimes breaks when using
          > Konqueror. Specifically, when I press REFRESH, but there's nothing new to
          > update the chatframe with. After that, REFRESH won't work again until I
          > reload the whole page.
          >[/color]

          See Lasse's response - Konqueror may need the full reference instead of
          the shortcut I'm used to (I do mostly intranet apps and only have to
          deal with NN/IE).

          --
          --
          ~kaeli~
          Press any key to continue or any other key to quit



          Comment

          Working...