#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    68
    Rep Power
    14

    Javascript for modal window


    Im sure this is prolly an easy question for you guru folk

    Does anyone have example JS code of how to keep a window modal ? I am popping up a box in which the person needs to enter a date. I would like this window to never lose focus until the user either answers it or presses cancel.... I would like to avoid using an alert box... Anyone?
    thanks in advance all..
  2. #2
  3. No Profile Picture
    Bringer of the Bling
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Orlando, FL
    Posts
    68
    Rep Power
    14
    var date = window.prompt("Enter a date:");
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    Christchurch, New Zealand
    Posts
    30
    Rep Power
    14
    Hey there

    IE4+ supports the showModalDialog method - this enables you to use an HTML document as your modal window.

    You can read all about that method here:

    http://msdn.microsoft.com/workshop/a...odalDialog.asp
  6. #4
  7. No Profile Picture
    Seņor Member
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2000
    Posts
    1,157
    Rep Power
    37
    In the body tag, specify the onBlur attribute with "self.focus()" as its value.
    Michael

IMN logo majestic logo threadwatch logo seochat tools logo