Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy to clipboard?
#11
IWLabel dont generate HTML focus controls and likely are not selectable either from the JS perspective.
Reply
#12
IWLabel to copy is out of question.

IWMemo works.... ONLY if its visible = true.

If I set to visible = false, then copy doesn't generate anything. No javascript error, but not is put into the clipboard.
Make it visible, then it works Sad
Reply
#13
If it isnt visible, it wont be rendered in most cases and JS cant select it. You can try rendering it while invisible.
Reply
#14
(04-30-2018, 02:20 AM)cpstevenc Wrote: IWLabel to copy is out of question.

IWMemo works.... ONLY if its visible = true.

If I set to visible = false, then copy doesn't generate anything. No javascript error, but not is put into the clipboard.
Make it visible, then it works Sad

I'm copying info from hidden fields using the DOM object on a 3rd party site, as a cobbled interface.   I haven't tried it in js but I don't see why copying that data into a js variable and placing it in the clipboard wouldn't work.

It's been a couple of years since I wrote that code, and it uses TWebBrowser (so IE specific) but I'd be surprised if you can't do the same thing in JS.  Some elements allow el.Value, others I use el.innerText or for checkboxes el.checked etc.

Note:  as I said, I programmed against the document object in TWebBrowser.  I do NOT claim to know JS (it makes me dizzy <g>).   Set the value into the variable, rather than trying to use Copy.

Dan
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)