Stop mouse clicking outside of popup box (IE 5.5)

E

Earl T

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
 
A

Alex Fitzpatrick

Earl said:
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'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/author/dhtml/reference/methods/showmodaldialog.asp
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top