"please wait..." in content frame during computation

Discussion in 'Javascript' started by carson.clan.nc@gmail.com, Nov 6, 2007.

  1. Guest

    I have found lots of discussion of said subject, but nothing I try
    will work. I'm hoping that starting this conversation with real
    living people in 2007 will help.

    I have two frames, left is toolbar, right is contents.
    <frameset cols="35%,65%">
    <frame src="../cgi-bin/cmpToolbar.py" name="toolbarFrame">
    <frame src="cmpContents.html" name="contentsFrame">
    </frameset>

    The left frame is CGI, which takes an HTML template file and fills in
    some pulldowns. The right frame is initially blank except for a
    title. Pushing the submit button on the left frame calls CGI script
    cmpRegressions.py, a slow computation/db access, so I want to repaint
    the right side with "please wait..." while this is happening. I want
    this to work after the right side has real contents too, obviously.

    The most straightforward way seems to be using onsubmit or onclick.
    Here is an excerpt of the template file which my left-side cgi fills
    in.

    <head>
    <script type="text/javascript">
    function waitMsg() {
    top.contentsFrame.location = "../cmpreg/cmpWaiting.html";
    document.forms["toolbar"].submit();
    }
    </script>
    <base target="contentsFrame">
    </head>
    <body>
    <FORM id="toolbar" name="toolbar" target=contentsFrame
    METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py" ENCTYPE="multipart/
    form-data">
    ....
    ....
    <input type="radio" name="inputType" value="buildset"
    onclick="parent.contentsFrame.location='../cmpreg/cmpWaiting.html';">
    ....
    ....
    <INPUT TYPE="submit" VALUE="compare" onclick="waitMsg(); return
    false;">
    </form>
    </body>


    Nothing I try will make the "submit" button change to the
    cmpWaiting.html page when I click it. It does do the submit() via the
    waitMsg() function, so the script is getting called AFAIK.

    Notice, however, that I try the onclick technique on the "radio"
    button in the middle of the form. It works fine! Of course, that
    input is not running the cmpRegressions.py script, which is what the
    submit button does.

    I've tried putting the javascript code inline in the <input>, I've
    tried onsubmit both in the <input> and in the <form>, I've tried too
    many things to name. I'm pulling out my hair as I write this. What
    am I missing?

    Thanks,
    David
    , Nov 6, 2007
    #1
    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. Microsoft
    Replies:
    3
    Views:
    695
    Hugo Wetterberg
    Oct 4, 2004
  2. hazz
    Replies:
    6
    Views:
    49,556
    SkyUCHC
    Jun 9, 2010
  3. traveller
    Replies:
    0
    Views:
    1,189
    traveller
    Jan 8, 2008
  4. Fokke Nauta
    Replies:
    3
    Views:
    934
    Fokke Nauta
    Apr 29, 2009
  5. tanager
    Replies:
    4
    Views:
    131
    Darko
    Nov 8, 2007
Loading...

Share This Page