Stop mouse clicking outside of popup box (IE 5.5)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Earl T

    Stop mouse clicking outside of popup box (IE 5.5)

    I am using IE only for this control I am building. I have created a
    rich text box that the user can popup (using dhtml and a div tag) to
    allow the user to enter wiziwig html text. However, when the popup is
    displayed, I would like to pervent the user from clicking outside of
    the popup. I can get it to partially work by putting an onclick event
    in the body tag and setting focus back to an element of the popup.
    However, buttons are still activated before this body tag event is
    called.

    I thought maybe I could cover the entire page with a div and put the
    rich text box div on top of it. Then the on click event for the page
    covering div could put focus back on the Rich Text Box Div.

    Then I thought that I must be tring to reinvent the wheel and that
    someone must have a good solution for this!

    Thanks for your help

    Earl
  • Alex Fitzpatrick

    #2
    Re: Stop mouse clicking outside of popup box (IE 5.5)

    Earl T wrote:[color=blue]
    > I am using IE only for this control I am building. I have created a
    > rich text box that the user can popup (using dhtml and a div tag) to
    > allow the user to enter wiziwig html text. However, when the popup is
    > displayed, I would like to pervent the user from clicking outside of
    > the popup. I can get it to partially work by putting an onclick event
    > in the body tag and setting focus back to an element of the popup.
    > However, buttons are still activated before this body tag event is
    > called.[/color]

    I've seen the whole-page div used as an event blocker (even did it
    myself to implement a wait cursor...) but if it's IE only, and you're
    emulating a "dialog like behavior" why not use the real thing?

    Say it with me slowly, MSDN is my friend.

    Gain technical skills through documentation and training, earn certifications and connect with the community


    --
    Alex Fitzpatrick
    Download JavaScript Editor PlugIn for Eclipse for free. The project is an Eclipse plugin that provides an editor for JavaScript files with syntax highlighting and outlining including some common OO approaches. Supported OO outline features are: Constructor, Class methods, Instance methods, Class variables etc

    Comment

    • Earl T

      #3
      Re: Stop mouse clicking outside of popup box (IE 5.5)

      Thanks Alex, That nails it!

      Alex Fitzpatrick <alex.nospam.fi tzpatrick@video tron.nospam.ca> wrote in message news:<ToJMb.738 40$8P6.1610509@ wagner.videotro n.net>...[color=blue]
      > Earl T wrote:[color=green]
      > > I am using IE only for this control I am building. I have created a
      > > rich text box that the user can popup (using dhtml and a div tag) to
      > > allow the user to enter wiziwig html text. However, when the popup is
      > > displayed, I would like to pervent the user from clicking outside of
      > > the popup. I can get it to partially work by putting an onclick event
      > > in the body tag and setting focus back to an element of the popup.
      > > However, buttons are still activated before this body tag event is
      > > called.[/color]
      >
      > I've seen the whole-page div used as an event blocker (even did it
      > myself to implement a wait cursor...) but if it's IE only, and you're
      > emulating a "dialog like behavior" why not use the real thing?
      >
      > Say it with me slowly, MSDN is my friend.
      >
      > http://msdn.microsoft.com/workshop/a...odaldialog.asp[/color]

      Comment

      Working...