Help with Javascript for FireFox

Discussion in 'Javascript' started by Mark, Nov 9, 2004.

  1. Mark

    Mark Guest

    Hi - I have the script below, which is supposed to populate a text box
    on a form which opened this popup window - it should then call a
    function 'PostThisPage' on the opener document, and then close the
    current window/popup.

    This works ok in IE - can anyone please help me by pointing out what it
    needs to become cross-browser compatible? It doesn't work in Firefox
    1.0.

    Thanks for any help, Mark

    <script>
    window.opener.document.forms(0).tbGoToDate.value = '2004-11-11';
    window.opener.PostThisPage();
    window.close();
    </script>






    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Mark, Nov 9, 2004
    #1
    1. Advertising

  2. On 09 Nov 2004 22:46:51 GMT, Mark <> wrote:

    [snip]

    > <script>


    Not related to the solution, but the SCRIPT element requires the type
    attribute:

    <script type="text/javascript">

    > window.opener.document.forms(0).tbGoToDate.value = '2004-11-11';


    The forms property is a collection - think "array". You use square
    brackets to subscript collections, not parentheses:

    opener.document.forms[0]

    You could go one step further and use the elements collection, too:

    opener.document.forms[0].elements['tbGoToDate']

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Nov 9, 2004
    #2
    1. Advertising

  3. Mark

    Mark Guest

    Thanks Mike - that works perfectly in IE and Firefox.

    Cheers, Mark



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Mark, Nov 10, 2004
    #3
    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. Replies:
    2
    Views:
    1,401
    Adrienne Boswell
    Jan 10, 2007
  2. DutchMaster11

    Javascript / FireFox help needed

    DutchMaster11, Jul 20, 2007, in forum: HTML
    Replies:
    4
    Views:
    499
    cwdjrxyz
    Jul 21, 2007
  3. VK
    Replies:
    9
    Views:
    95
  4. DutchMaster11

    Javascript / FireFox help needed

    DutchMaster11, Jul 20, 2007, in forum: Javascript
    Replies:
    9
    Views:
    144
    Thomas 'PointedEars' Lahn
    Jul 30, 2007
  5. Joseph

    Firefox Javascript Help!! :(

    Joseph, Feb 26, 2008, in forum: Javascript
    Replies:
    9
    Views:
    104
    Joseph
    Mar 13, 2008
Loading...

Share This Page