04-23-2018, 04:06 AM
(04-23-2018, 03:22 AM)cpstevenc Wrote: Using 14.2.7 with Tokyo Update 3 , HTTPS enabled.
I have a TIWLabel , that uses RawText = true, which for now is named ( and friendly name) lbl_NumberText
I want to be able to copy the text inside this to the clipboard.
I already know this is tricky in itself, depending on Browser... browser version... http vs https.
Using this as an example @ https://www.w3schools.com/howto/howto_js...pboard.asp
I use the onClick ScriptEvent on a button do just do the javascript code
Code:var copyText = document.getElementById("lbl_NumberText");
copyText.select();
document.execCommand("Copy");
alert("Copied the text: " + copyText.value);
This appears to not work as it never gets to the "alert" section .... I assume the script code is aborting as I am sure "lbl_NumberText" for getElementById is not quite correct.
Instead of the .FriendlyName, try using .Name.
The control id is what you're looking for. When I look at the DOM, that shows .Name in the id.
Dan