Setting Focus

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

    Setting Focus

    Currently in my html document I use the onload command inthe body section to
    set the focus to a certain field.

    eg

    onload="documen t.form1.SerialN o.focus()"

    Is there a way to set the focus to another field in a different frame other
    than the one that the current document is in?

    In my example, I have a frame called "top" that I would like the focus
    setting to whenever a certain document is loaded in the frame "main".

    My apologies if this is posted in the wrong newsgroup.

    TIA

    Darren.



  • mscir

    #2
    Re: Setting Focus

    Darren Line wrote:[color=blue]
    > Currently in my html document I use the onload command inthe body section to
    > set the focus to a certain field.
    >
    > onload="documen t.form1.SerialN o.focus()"
    >
    > Is there a way to set the focus to another field in a different frame other
    > than the one that the current document is in?
    >
    > In my example, I have a frame called "top" that I would like the focus
    > setting to whenever a certain document is loaded in the frame "main".
    >
    > My apologies if this is posted in the wrong newsgroup.
    >
    > TIA
    > Darren.[/color]

    I'd rename the frame "top" something like "topframe" so it isn't
    confused with the top level of the frame tree. You can read about that
    here if you're not familiar with it already:



    I'd try something like this:

    <body onload="top.fra mename.document .formname.input fieldname.focus ()">

    Mike

    Comment

    • Darren Line

      #3
      Re: Setting Focus

      Excellent!!!

      That worked a treat.

      As you said, I needed to rename the frame.

      Thanks for that.

      Darren.


      "mscir" <mscir@access4l ess.com.net.org .uk> wrote in message
      news:106np4h7ok m386b@corp.supe rnews.com...[color=blue]
      > Darren Line wrote:[color=green]
      > > Currently in my html document I use the onload command inthe body[/color][/color]
      section to[color=blue][color=green]
      > > set the focus to a certain field.
      > >
      > > onload="documen t.form1.SerialN o.focus()"
      > >
      > > Is there a way to set the focus to another field in a different frame[/color][/color]
      other[color=blue][color=green]
      > > than the one that the current document is in?
      > >
      > > In my example, I have a frame called "top" that I would like the focus
      > > setting to whenever a certain document is loaded in the frame "main".
      > >
      > > My apologies if this is posted in the wrong newsgroup.
      > >
      > > TIA
      > > Darren.[/color]
      >
      > I'd rename the frame "top" something like "topframe" so it isn't
      > confused with the top level of the frame tree. You can read about that
      > here if you're not familiar with it already:
      >
      > http://www.quirksmode.org/js/frameintro.html
      >
      > I'd try something like this:
      >
      > <body onload="top.fra mename.document .formname.input fieldname.focus ()">
      >
      > Mike
      >[/color]


      Comment

      Working...