Help with Javascript for FireFox

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

    #1

    Help with Javascript for FireFox

    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.d ocument.forms(0 ).tbGoToDate.va lue = '2004-11-11';
    window.opener.P ostThisPage();
    window.close();
    </script>






    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Michael Winter

    #2
    Re: Help with Javascript for FireFox

    On 09 Nov 2004 22:46:51 GMT, Mark <nospam@devdex. com> wrote:

    [snip]
    [color=blue]
    > <script>[/color]

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

    <script type="text/javascript">
    [color=blue]
    > window.opener.d ocument.forms(0 ).tbGoToDate.va lue = '2004-11-11';[/color]

    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.

    Comment

    • Mark

      #3
      Re: Help with Javascript for FireFox

      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!

      Comment

      Working...