Results 1 to 4 of 4
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Changing text in a text box on another fram (Front

    I have a simple frameset with three frames called banner, content and detail. (All basic stuff)
    The content frame has simple hyperlink buttons to load the detail frame and this works fine.
    I also want to change a text box in the banner title frame called txttitle when the button is pressed.

    The reference on the hyperlink is set up as below.

    <a href="day2.htm" Onclick="day2title()" DAY 2 /a>

    In the above...

    day2.htm is the page to be loaded into the detail frame and the javascript function to be called is day2title()
    The javascript function is defined in the header of the content frame as below (also basic stuff).

    function day2title()
    {
    parent.banner.txttitle.value='Whatever text I wish to appear in the banner field called txttitle'
    parent.banner.txttitle.visible=true
    }

    So my problem is this.

    The detail page loads just fine.
    On IE6 and IE7 the javascript runs and all is dandy.

    BUT on Firefox/2.0.0.4 although the detail frame loads, the javascript does not execute.

    Is this something to do with Firefox, or do I need to change some settings in my firefox, or
    do I need to change the code to make it work in firefox?

    Many thanks

    Andrew
    Andrew

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Changing text in a text box on another fram (F

    Try using a more modern reference to your target. For example, if you had:

    <code><input id="txttitle" name="txttitle" value=""></code>

    Then I think you could reference it as following:

    <code>window.parent.frames["banner"].document.getElementById('txttitle').value='Whatev er text I wish to appear in the banner field called txttitle'</code>

    But I haven't actually coded up all the necessary pages to test that...

    If that doesn't help, check your Errors Console (Tools menu) for any more specific error messages.

  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Changing text in a text box on another fram (F

    I tried that reference method BUT it still makes no difference in Firefox.
    It works fine in IE6 and 7.
    I also downloaded Opera 9 to test that and it works fine in that as well.

    It appears that this is a Firefox issue.
    Meybe it is a problem Firefox has with frames.
    Maybe it is my configuration of Firefox on my PC.
    However, I have javascript enabled and even set the test site to allow pop-ups
    but still no Joy.

    Any other ideas gratefully tested.
    Andrew

  4. #4
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Changing text in a text box on another fram (F

    I apologise. You are a fine fellow indeed!

    This does work!

    I had omitted to put the id="txttitle" into the text box on the page for the banner frame.

    Still odd that it worked just fine in the other Browsers but flawed Firefox though.

    Ho Hum!
    Andrew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •