Set focus to a frame

Results 1 to 5 of 5

Thread: Set focus to a frame

  1. #1
    lixiz Guest

    Default Set focus to a frame

    &#060;frameset rows="80,*"&#062;<BR>&#060;frame name="banner" scrolling="no" noresize src="../tote/adminhead.htm"&#062;<BR>&#060;frame name="aMain" src="../tote/adminMain.htm" frameborder=0&#062;<BR>&#060;/frameset&#062;<BR><BR>How do I set default focus to frame "aMain"?<BR>(meaning "aMain" is the selected frame)<BR><BR>Thanks

  2. #2
    jason Guest

    Default RE: Set focus to a frame

    javascript.<BR><BR>in the frame you want to focus on<BR><BR>&lt;body onload="self.focus()"&gt;<BR><BR>or in the banner frame <BR><BR>&lt;body onload="top.frames[&#039aMain&#039].focus()"&gt;<BR><BR>jason<BR>Infinitemonkeys web programming resource<BR>

  3. #3
    lixiz Guest

    Default How about vbscript?

    Can the frame focus be done with vbscript?<BR><BR>Thanks.

  4. #4
    jason Guest

    Default RE: How about vbscript?

    exactly the same, but use () instead of [] (see note below)<BR><BR>the window object is part of the browser, not actually part of the language, so it&#039s methods and properties are exactly the same, and can in theory be called from any scripting language. with IE this means (in theory) you could use perlscript or python to write dHTML, but I&#039m not 100% on whether that works<BR><BR>If i remember correctly, VBScript likes you to use heavy dot-syntax, so if the frame you want to focus is called &#039nav&#039 you&#039d use something like top.frames.nav.focus()<BR><BR>jason<BR><BR><BR>

  5. #5
    lixiz Guest

    Default No effect...

    Please help again.<BR>Thanks

Posting Permissions

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