Control-A (Select All) not working with pop-up window

I have a pop-up window that shows some text. User wants to be able to click on the window, click “Control-A” (to select all text), then copy the text. When they do “Control A” it selects all of the text in the browser. Is there any way to do this?

Here is how I construct the window (simplified for this post):

dhxWins = new dhtmlXWindows();
win = dhxWins.createWindow("PackageSource", 0, 0, 600, 600);
win.button("close").attachEvent("onClick",function() {
win.setText("Show Package Source");;

var pkgsourcediv = document.getElementById('pkgsourcediv')

var textarea = document.getElementById('pkgsourcetxt');
if (textarea.outerHTML)
   textarea.outerHTML = '<pre id="pkgsourcetxt">'+ result +'</pre>';
   textarea.innerHTML = result;

Where the DIV we’re attaching is:

<div id="pkgsourcediv" style="width:100%;height:100%;overflow:auto;display:none;">
    <pre id='pkgsourcetxt'></pre>

Is not the window text selected when you press ctrl+A ? Are you using the latest version ?

Yes, window is selected first.

This happens on both IE7 and Firefox 3.

How can I tell if I have the latest version?

So, what doesn’t work if window text is selected ?

The scenario is that we have a modal window that appears on top of the base application. The window contains text. When user clicks Cntl-A it selects ALL text in the browser… including the base application as well as the text in the window.

We want to be able to click in the window and click Cntl-A and only select the text contents of the window. I could provide a screenshot but it is a proprietary product under development.

You may try to resolve the problem using an iframe. If the iframe is focused, ctrl+A will select only iframe content.

attachURL creates an iframe automatically and loads the url that is defined in it into this iframe.


So, the window content should be in a separate page.