Highlight selection of <DIV>'s text content in a Modal Dialog

T

tungchau81

Hi,
A Modal Dialog does not allow us to highlight the text content inside
<DIV> tag unless I use a <textarea> tag to display that text content.
However, the situation of my software makes it impossible to use
<textarea> and Modeless dialog. I am really stuck!!!

Is there any trick to make <DIV> or <SPAN>'s content be selectable in a
Modal dialog?

Thanks in advance,

Tung Chau
 
M

Martin Honnen

A Modal Dialog does not allow us to highlight the text content inside
<DIV> tag unless I use a <textarea> tag to display that text content.
However, the situation of my software makes it impossible to use
<textarea> and Modeless dialog. I am really stuck!!!

Is there any trick to make <DIV> or <SPAN>'s content be selectable in a
Modal dialog?

Perhaps if you put your dialog page in an iframe e.g. newDialog.html is
<html>
<head>
<title>dialog title</title>
<style type="text/css">
html, body { margin: 0; padding: 0; }
</style>
</head>
<body>
<iframe width="100%" height="100%" src="originalDialog.html">
</iframe>
</body>
</html>
then inside the iframe text selection is possible if call
window.showModalDialog('newDialog.html')
but I haven't tried that.

It seems like a bug if text selection in the dialog doesn't work, you
might want to search the MS knowledge base if that is known and
workarounds are suggested.
 
T

tungchau81

Just wanted to add one more point. The reason I do not want to make my
<DIV> editable because I do not want the user to be able to edit the
content inside my DIV, but just to select the content.

Tung Chau.
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top