Solved

Allow selecting text in modal dialog

Posted on 2006-06-11
12
369 Views
Last Modified: 2008-02-01
Hi

I have a window which is popped up by window.showModalDialog() method.  My users want to copy some text in this dialog window and then paste in another window after closing the dialog.  However the modal dialog window does not allow users to select text content using mouse cursor.
 
Is this a limitation of dialog window?  Any work around?
0
Comment
Question by:Edwin_C
  • 6
  • 5
12 Comments
 
LVL 3

Expert Comment

by:a122178
ID: 16883474
Can you implement a "Select All" button to solve the problem?
0
 
LVL 16

Author Comment

by:Edwin_C
ID: 16883491
"Select All" (pressing Ctrl-A) does not work.  Moreover the users need selecting some text but not all.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16883986
Here a workaround: http:Q_21581323.html
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 63

Expert Comment

by:Zvonko
ID: 16884016
You can even have  a <textarea> with no borders:
<textarea style="border:0px; width: 100%; height:100%; overflow:hidden;">
Here some text
</textarea>



0
 
LVL 16

Author Comment

by:Edwin_C
ID: 16884144
Hi Zvonko

Thank you for your reply.  Actually the modalDialog is a ASP.NET WebForm and its content is generated by my .NET code using a DataGrid ASP.NET control.  I think the details of .NET is not important here but I just cannot put my ASP.NET DataGrid control inside <textarea> tag because ASP.NET will not recognize them as code.  Is using textarea tag the only way to do it?  Can I use DIV or something to achieve the same result?

Edwin
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16884769
It the referenced answer there is the option to set the div to style editable area. Try that.
0
 
LVL 16

Author Comment

by:Edwin_C
ID: 16890830
Sorry! I can't follow.  In the referenced answer http:Q_21581323.html, only <textarea> is used to surround the text.  I cannot find mentioning <div>.  Have I missed something?

0
 
LVL 63

Accepted Solution

by:
Zvonko earned 500 total points
ID: 16892547
Sorry, it seams I have read it in a simelar question.
But it goeas like this:

<html>
<head>
<title>Zvonko &#42;</title>
</head>
<body>
<h1>This Header NOT selectable</h1>
<div contentEditable>
<h1>But this one is selectable</h1>
And all following text in the DIV
</div>
</body>
</html>




0
 
LVL 16

Author Comment

by:Edwin_C
ID: 16892792
Amazing!  I have never thought about having this attribute.  Now users can select the text content but they can also modify the content which is some what undesirable.  The best thing to have is to allow them to select some text (then they press ctrl-C) but not allowing them to change the content.  Any more ideas?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16892897
The question is: Why it has to be Modal at all?
0
 
LVL 16

Author Comment

by:Edwin_C
ID: 16892971
Because it is a screen for users to make selection.  I don't want the users to switch to other screen until they make their choices or close the parent screen leaving the selection screen open or go back to the parent screen and then open multiple selection screens.  
0
 
LVL 16

Author Comment

by:Edwin_C
ID: 16908381
Zvonko
Thank you for your solution.  It is a viable solution to the problem althought it has its side effect.
Edwin
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question