Results 1 to 20 of 20

Thread: keeping popup ontop

  1. #1

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    keeping popup ontop

    I am trying to create a modal window for a user to enter some info before moving on. I have been using:
    Code:
    <body "onBlur="document.focus()">
    but on this particular popup that I am working with I have a frameset. So what I did was:
    Code:
    <frameset rows="100%,*" onBlur="document.focus()">
    that works fine untill the user clicks on a input field on the form, then the window will be allowed to lose focus. How do I fix this?
    thanks
    michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    frames are so 1990's, man. Use tables.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    lol... I think what I am doing is quite 21st century I am using the hidden frame to update and retrieve values from the database when the user tabs out of a field then updating items on the form w/o refreshing... this is done in the 0% frame using a combo of ASP and javascript (via outerHTML).
    My guess is you dont have a solution to my prob though?
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I quiet frankly don't see why you want it to be modal. If they continue without entering the information, give them an error page.

    But no, I don't have an answer for your question. I haven't dealt with frames in awhile.

    When I think of frames, I think of those teeny sites with the green backgrounds and horrible nasty colors and you always got frustrated when you could move their frames around, and it all just made you want to b*tch-slap them for making it.

    And all that kinda turns me off from frames. But best of luck to you.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by The Hobo
    I quiet frankly don't see why you want it to be modal. If they continue without entering the information, give them an error page.
    since the page does all its processing without refreshing it would be more work to check if the user is making an error than it is to prevent the user from making an error.
    No offence taken about the frames comment, this site uses multiple layers of frames yet the user would never know it by looking. and by the way, tables are so 2000, use liquid css.
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Everyone's always got a newer idea...

    I know css...what's liquid css?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by The Hobo
    I know css...
    do you use css to postion elements on your pages? if you did then you would no longer have need for tables to do layouts, which, depending on your amount of nesting, can get complex and get to be many lines of code long (good luck going back into some code with 500+ lines of nested tables). liquid css is the tecnique of using percentages to layout your elements without using tables.
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  8. #8
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i'm confused, is the form on the popup window?

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  9. #9
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by msimmons

    do you use css to postion elements on your pages? if you did then you would no longer have need for tables to do layouts, which, depending on your amount of nesting, can get complex and get to be many lines of code long (good luck going back into some code with 500+ lines of nested tables). liquid css is the tecnique of using percentages to layout your elements without using tables.
    Michael
    Oh. I never knew there was a specific name for that. Thanks.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  10. #10
    scoutt
    Guest
    Originally posted by msimmons

    do you use css to postion elements on your pages? if you did then you would no longer have need for tables to do layouts, which, depending on your amount of nesting, can get complex and get to be many lines of code long (good luck going back into some code with 500+ lines of nested tables). liquid css is the tecnique of using percentages to layout your elements without using tables.
    Michael
    hehe liquid CSS, never heard of it either. I think you just made it up.

    most people call them layers and such, but anyway, tables are used becasue Netscape doesn't play nice with CSS or even liquid css. so tables are still 22nd century all the way.

  11. #11

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by sail3005
    i'm confused, is the form on the popup window?
    Yes, this is like a control panel type page where the user clicks "buttons" to pop up windows with forms on them. I want to prevent the user form doing something else on the control panel before doing what they want to do with the pop up

    Originally posted by scoutt
    hehe liquid CSS, never heard of it either. I think you just made it up.
    Heard of google? here is the top listing in a search for Liquid CSS:
    http://www.saila.com/usage/layouts/

    Originally posted by scoutt
    but anyway, tables are used becasue Netscape doesn't play nice with CSS or even liquid css. so tables are still 22nd century all the way.
    nah Netscape is just 18th century

    thanks,
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  12. #12
    Member Vincent Puglia's Avatar
    Join Date
    Feb 2002
    Location
    where the World once stood
    Posts
    36
    Hi Michael,

    Instead of onBlur='something.focus()', why not try something like:

    if (myWin) this.blur()

    Essentially, you blur the main page and thereby force the entire popUp to be focused.

    Vinny

  13. #13

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    pardon my ignorance but where would I put that? My assumption is in the on focus of the form that created the popup?
    thanks in advance,
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  14. #14
    Member Vincent Puglia's Avatar
    Join Date
    Feb 2002
    Location
    where the World once stood
    Posts
    36
    Hi Michael,

    Where -- depends upon the pages themselves. I get the impression that you are using a main page (consisting of one or more frames) and a number of possible popUps. However, since I don't know what the page/layout/app really look like....

    2 things to consider:

    1) if there are a number of popUps w/forms that you are contending with, try putting their names within an array that can be accessed by the opener window/frame

    2) if the user can shift focus to more than one area/window/document, you will need either to put the 'this.blur()' within each form or use a setTimeout to continually check the status.

    Vinny

  15. #15

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    When I used "this.blur()" it worked but it minimized the main window... so I switched that to "myWin.focus()" and that worked fine until I closed the window. Then I would receive the error:
    The callee [server [not server application]] is not available and dissapeared; all connections are valid. The call did not exicute.

    the function that pops up the window (called by onClick):
    [code]
    function showOffsets(newVar, newVar2){
    offsetWin = window.open('rateoffsets.asp?Rate=' + newVar + '&Room=' + newVar2, 'newOffsets');
    }
    [\code]

    the function that gives it focus (called in the body onFocus of the page containing the onClick):
    [code]
    function giveChildFocus(){
    if (offsetWin){
    offsetWin.focus();
    }
    }
    [\code]

    Its probably something simple I cant find.
    Thanks in advance,
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  16. #16

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    i think i figured it out... i need to kill the "myWin" (or offsetWin in my case) variable onUnload of the popup.
    michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  17. #17

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Thanks, that did it. I actualy had something similar in an earlier project of mine but had forgotten all about it.
    Thanks again,
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  18. #18
    Member Vincent Puglia's Avatar
    Join Date
    Feb 2002
    Location
    where the World once stood
    Posts
    36
    Hi Michael,

    Glad you worked it out. And sorry I didn't get a chance to get back to you.

    Vinny

  19. #19

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    sorry about that, need more coffee... it does work now, i was just clicking on another frame that didnt have the script included.
    oops,
    michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  20. #20

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    if anyone wants the long and probably more difficult than it needs to be explanation of how I overcame my popup problem i will post it.
    ok, here we go:

    first in the script of my form that opens the pop up (we will call it "the parent" from now on) i initialize a javascript variable called myWin:
    var myWin = 0
    and in an onClick of a button I open the popup (we will call it "the child" from now on) I did this:
    Code:
    function showCalendar(newVar){
      myWin = window.open('ratecalendar.asp', 'newCalendar');
    }
    In all the frames of the parent (I admit, i used alot of frames to keep things where I wanted them when the user resized the screen because this is a non scrolling 1 screen panel) I added this function called by both the onClick and the onFocus:
    Code:
    function giveChildFocus(){
      if (top.frames[1].frames[2].myWin){
          top.frames[1].frames[2].myWin.focus();
      }
    }
    so, if the child is open then the page/frame will give it focus. Then when the child is closed I erase the variable like this:
    Code:
    onUnload="window.opener.myWin=0;"
    so now any clicks to the parent or surounding frames will check and since the child is not there will just go about their business and normal
    I just hope I remember all of that on the next project I have that calls for popup's or I'll be back here asking again
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

Posting Permissions

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



Click Here to Expand Forum to Full Width