Setting focus to new window

Discussion in 'ASP .Net' started by kloppie, Nov 28, 2006.

  1. kloppie

    kloppie Guest

    Hi there,

    im working on a page which causes me problems - the page contains of a
    couple of controls where the user can choose some options for a Report.
    When the user then clicks a button "Submit" the server-side code saves
    the users selected options into Session-variables and then registers a
    startup-clientscript. This script calls the javascript function
    "window.open".
    My problem is that the new window does not get focus, it hiddes behind
    the parent window.
    I tried calling focus() in "onload" of the body of the new window, but
    that is not fired until the entire page is loaded - i want it to get
    focus immediatly.
    Is that possibly?

    I hope somebody can help me out here,

    Regards, Martin
    kloppie, Nov 28, 2006
    #1
    1. Advertising

  2. kloppie

    Greg9Strat Guest

    Is the javascript command "window.open()" the last command in script?
    Wondering if other scripts are conflicting...

    As to your other question, I believe you could put a
    <script>getfocus...</script> block in the header to fire before the
    "onload" command is fired for page body.

    HTH

    On Nov 28, 3:14 pm, "kloppie" <> wrote:
    > Hi there,
    >
    > im working on a page which causes me problems - the page contains of a
    > couple of controls where the user can choose some options for a Report.
    > When the user then clicks a button "Submit" the server-side code saves
    > the users selected options into Session-variables and then registers a
    > startup-clientscript. This script calls the javascript function
    > "window.open".
    > My problem is that the new window does not get focus, it hiddes behind
    > the parent window.
    > I tried calling focus() in "onload" of the body of the new window, but
    > that is not fired until the entire page is loaded - i want it to get
    > focus immediatly.
    > Is that possibly?
    >
    > I hope somebody can help me out here,
    >
    > Regards, Martin
    Greg9Strat, Nov 29, 2006
    #2
    1. Advertising

  3. kloppie

    kloppie Guest

    Hi Greg9Strat,

    tried the <script>getfocus.... but that didn't work either.

    It seems like the new window gets focus but then the parent window does
    some processing and therefore gets the focus back...


    Greg9Strat skrev:
    > Is the javascript command "window.open()" the last command in script?
    > Wondering if other scripts are conflicting...
    >
    > As to your other question, I believe you could put a
    > <script>getfocus...</script> block in the header to fire before the
    > "onload" command is fired for page body.
    >
    > HTH
    >
    > On Nov 28, 3:14 pm, "kloppie" <> wrote:
    > > Hi there,
    > >
    > > im working on a page which causes me problems - the page contains of a
    > > couple of controls where the user can choose some options for a Report.
    > > When the user then clicks a button "Submit" the server-side code saves
    > > the users selected options into Session-variables and then registers a
    > > startup-clientscript. This script calls the javascript function
    > > "window.open".
    > > My problem is that the new window does not get focus, it hiddes behind
    > > the parent window.
    > > I tried calling focus() in "onload" of the body of the new window, but
    > > that is not fired until the entire page is loaded - i want it to get
    > > focus immediatly.
    > > Is that possibly?
    > >
    > > I hope somebody can help me out here,
    > >
    > > Regards, Martin
    kloppie, Nov 29, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Morrissey

    Setting Window Title On New Window

    Daniel Morrissey, Jul 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    493
    Vidar Petursson
    Jul 15, 2003
  2. Jason
    Replies:
    4
    Views:
    1,617
    Jason
    May 7, 2007
  3. Csaba Gabor

    focus on the new window.open window

    Csaba Gabor, Nov 30, 2005, in forum: Javascript
    Replies:
    4
    Views:
    210
    Csaba Gabor
    Dec 1, 2005
  4. Roger
    Replies:
    3
    Views:
    322
  5. Spizzat2
    Replies:
    2
    Views:
    177
    Spizzat2
    Jan 9, 2008
Loading...

Share This Page