473,657 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Jul 23 '05 #1
3 4342


tu********@yaho o.com wrote:

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="originalDi alog.html">
</iframe>
</body>
</html>
then inside the iframe text selection is possible if call
window.showModa lDialog('newDia log.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.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
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.

Jul 23 '05 #3
Thanks Martin. I tested that and it didn't work. No matter the DIV is
in iframe or not, as long as it is loaded into a Modal Dialog
container, it won't be selectable.

Tung Chau

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2501
by: Philo | last post by:
How do I select all <div> tags except those which contain a <table> tag somewhere within them? Example XML: <********************** sample input ***********************> <txtSectionBody> <div> <span>
1
5802
by: OM | last post by:
I've found out that I can use <div id = "variable"><div> to change text and pictures on mouseovers. All I have to do is change "variable" to be the HTML text I want. I can even change the text to have images. Is this method recommended? Should I be doing it another way?
3
6495
by: Jens Kristensen | last post by:
I have a problem displaying a divbox containing a html-textarea - everything works fine with "normal" characters. However, when the textarea contains special chars like <P> or ' , the box fails to show: function show(divbox) { divbox.style.display=''; } <div id="divbox" style="display:none" >
44
919
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to put either tag inside an HTML <TD> and have the same kind of scrolling effect. This would allow me to fill the screen and have the size of the scrolling box change on resize. Thanks in advance.
6
9074
by: Gregory | last post by:
Hi all. A quick question. In normal XHTML pages, you can put text inside of a <div> element, and all goes well. Essentially, im trying to port over some XHTML stuff into asp.net, but add in dynamic generation, blah, blah, blah. So i need to be able to add text to a div from the code behind. Any way
2
2094
by: Ruskin Hardie | last post by:
There is an iframe in my document that is hidden, which is the target for a submitted form. When the form is submitted, some javascript sets a hidden div, to displaying, eg: document.getElementById('hiddendiv').style.display = ''; This div, simply has the words "building csv file, please wait", and is used, because their is no indication in IE, as to what is happening, when the user clicks on 'Results in CSV format', to return a report...
5
1786
by: Stan R. | last post by:
Greetings. I have a couple of questions concerning CSS layouts, as apposed to the old <tablemethod for creating layouts . Even after spending the last few days searching all over Google Groups, I haven't not been able to find a solution to my collective dilemma, and I hope some of you fine folks here in these neck of the UseNet woods might be able to share some wisdom with a fellow coder. My questions are in regard to what are the proper...
4
2121
by: plumba | last post by:
Let me explain.... I have a form (most of which you guys have helped me with!!). The initial problem I was having is that it was holding the data in the fields after submit, I resolved this by putting the whole form in a set of <div> tags and the form now collapses after they click submit. Perfect!! But, have set some mandatory fields using java, and I need to it validate the these fields before it collapses the form - otherwise it says...
8
10029
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.