SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member atem451's Avatar
    Join Date
    May 2001
    Location
    Berlin
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re-focus window on blur

    I have a Page with a textarea that should no go into the background (->blur).
    I tried to do this with
    <body OnBlur="self.focus()">
    ...
    <form ...>
    <textarea name=...></textarea>

    ...
    At first, it had the effect I wanted, but then I realized, that it's impossible to insert any text into the textarea.
    When ever I try to write something, nothing happens!

    For some reasons, the only way to insert text is to copy some text from somewhere else, and then paste it not by Ctrl+V, but by "rightclick" -> "Paste".
    The only way to remove text from the textarea is to do this by:
    "rightclick" -> "Delete" || "Cut"

    The Page that should not close is opened by an onClick-Event on another page, which contains a Form as well.
    My Problem is, that this original form should not be submitted, before the newly opend form is closed or submitted (it closes itself after it's submitted)

    Any Help with my original Idea or suggestions how to solve the problem?


    Footbag: Spread the Spirit

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is supported by IE and is just what you need:

    window.showModalDialog(url,dialogArguments,windowHeight/width/helpButton etc);

  3. #3
    SitePoint Member atem451's Avatar
    Join Date
    May 2001
    Location
    Berlin
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, but this is not what I need.
    I really have to to open a completely new page in a seperate window (this page has to receive some data and will perform some additional php/mysql-action),
    so this ie-feature will hardly help me.

    Any other suggestions?
    Footbag: Spread the Spirit

  4. #4
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that is exactly what this does. it will open your 'completely different' page in a window but will give that window modal properties (ie it will retain focus until it is closed). You can run php or whatever you want inside the window.

  5. #5
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i forgot to mention, you can pass information into the modal and pass information from the modal back to your main page(which it will get when the modal closes).

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The code you gave does not insure that the page is always focused on.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  7. #7
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, its more of a pseudo code as I don't know how it will be used. I tried to make it obvious with the parameters. Jeremy, do you have any experince with these? I develop only for IE and they work great.

    By the way, it does ensure that the window is always focused on because it has modal properties. Once this thing launches, you can't do anything until you close the window. It is different from a popup.
    Last edited by makeda; Sep 25, 2001 at 10:23.

  8. #8
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    www.studiococo.com/custom.asp?window.asp generates the above code perfectly for all browsers.

    Problem is it still doesn't handle the initial problem of keeping the top window focused until the user is "done".

    To be honest, this problem has me thinking...
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  9. #9
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is a nice reference to what I am referring to:

    http://www.webreference.com/js/tutorial1/dialog.html

  10. #10
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I stand corrected

    Well done makeda. It should again be noted that it IS an IE specific solution and it won't work in any other browser
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


Bookmarks

Posting Permissions

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