Setting Focus

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

    Setting Focus

    Greetings all, and many thanks for your helpful replies to my earlier post
    today. I have another question now, if you would be so kind again:

    How do I make it so that the cursor appears in a text field automatically
    when a web page loads, or after data has been cleared from the field with a
    clear button?

    Regards


  • Andi B

    #2
    Re: Setting Focus

    Thanks - in addition, I forgot to ask this earlier: the form creates a popup
    window to display results from a user search. There is a script controlled
    close button on the popup page - is it possible to have this close the popup
    window, and then move the focus back to the form element?

    "Janwillem Borleffs" <jwb@jwbfoto.de mon.nl> wrote in message
    news:3f3d63c1$0 $28902$1b62eedf @news.euronet.n l...[color=blue]
    >
    > "Andi B" <andi@theblackt ower.freeserve. co.uk> schreef in bericht
    > news:bhjkmv$1lj $1@news8.svr.po l.co.uk...[color=green]
    > > Greetings all, and many thanks for your helpful replies to my earlier[/color][/color]
    post[color=blue][color=green]
    > > today. I have another question now, if you would be so kind again:
    > >
    > > How do I make it so that the cursor appears in a text field[/color][/color]
    automatically[color=blue][color=green]
    > > when a web page loads, or after data has been cleared from the field[/color][/color]
    with[color=blue]
    > a[color=green]
    > > clear button?
    > >[/color]
    >
    > window.onload = function () { document.formNa me.fieldName.fo cus(); }
    >
    > <form name="f" onreset="fieldN ame.focus()">
    >
    >
    > JW
    >
    >
    >
    >
    >[/color]


    Comment

    • Janwillem Borleffs

      #3
      Re: Setting Focus


      "Andi B" <andi@theblackt ower.freeserve. co.uk> schreef in bericht
      news:bhjq7h$1vm $1@news7.svr.po l.co.uk...[color=blue]
      > Thanks - in addition, I forgot to ask this earlier: the form creates a[/color]
      popup[color=blue]
      > window to display results from a user search. There is a script[/color]
      controlled[color=blue]
      > close button on the popup page - is it possible to have this close the[/color]
      popup[color=blue]
      > window, and then move the focus back to the form element?
      >[/color]

      Shure, just use:

      opener.document .formName.field Name.focus();

      In your close function

      JW



      Comment

      Working...