This content has been marked as final. Show 5 replies
Yep...thought so. Thanks for confirming Rick. This whole episode came about because the developer originally had the code is an ordinary table cell. Trouble was that when you copy and paste from a table cell you get an additional carriage return at the end of each line. The only way around this that I found was using the multiline text field.
Hi again Colum
If it's WebHelp, I'm doubtful it would work. Might in IE, but would probably fail in others. Or, you could do both. Use the table cell for the color coding display, then insert the text field to store the contents of what you wish to copy. Then on click have some script that selects the text so all they do is press ctrl+C to copy it.
Just some thoughts from a bald midwestern madman on a humid Tuesday morning... Rick
Hi Rick. Hope you've not melted by now . I was talking - well ok drinking - with Peter last night who mentioned the "link" button you guys use in RoboKnowledge. Is this what you were referring to? It sounds promising as it is a CHM file we are dealing with here.
element.select(); // Only works for text boxes.
textRange = document.selection.createRange();
Change the button properties to Control Type = Plain Button, Button Caption = Copy to Clipboard, Control Identifier – Delete the default value to leave a blank field. Also add Add onclick="copy2Clipboard(namehere)" to the end of your <input type=submit value=Button> statement.
Change the multi-line text field properties to Control Identifier = namehere (where namehere is the value you specified above), Initial text = Paste the code snippet to be copied to the PC clipboard. Also add style="height: 1px; width: 0px;" to the end of the multi-line text area code.
Note: If the above style statement is set to style="height: 0px; width: 0px;"> a bug generates acres of blank space between the end of the multi-line text box and any other following content. If the multi-line text box is the last part of the topic content this is OK but otherwise the code above must be used.