[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

Allow selecting text in modal dialog

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
Edwin_C
Asked:
Edwin_C
  • 6
  • 5
1 Solution
 
a122178Commented:
Can you implement a "Select All" button to solve the problem?
0
 
Edwin_CAuthor Commented:
"Select All" (pressing Ctrl-A) does not work.  Moreover the users need selecting some text but not all.
0
 
ZvonkoSystems architectCommented:
Here a workaround: http:Q_21581323.html
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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



0
 
Edwin_CAuthor Commented:
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
 
ZvonkoSystems architectCommented:
It the referenced answer there is the option to set the div to style editable area. Try that.
0
 
Edwin_CAuthor Commented:
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
 
ZvonkoSystems architectCommented:
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
 
Edwin_CAuthor Commented:
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
 
ZvonkoSystems architectCommented:
The question is: Why it has to be Modal at all?
0
 
Edwin_CAuthor Commented:
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
 
Edwin_CAuthor Commented:
Zvonko
Thank you for your solution.  It is a viable solution to the problem althought it has its side effect.
Edwin
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now