I've found several scripts for copying a textbox value to the clipboard.
Here's the function I am using:
it to work is on a textbox in a form #project-entry-form--folder-location with a button to call the function #project-entry-form--folder-location-copy The textbox and button are there on page load, the VALUE of the textbox is generated as the user makes certain choices in the form.
THE FUNCTION IS FIRING... If I click the button, the message generated at the bottom of the copyToClipboard() function comes up. So, I know the click functionality is working and the function is firing. But, nothing is on the clipboard. For some reason it doesn't get any value for the element passed to it.
I can alert() the value of the textbox from within the same click event and that works. So, I know the textbox's value is accessible.
I cannot figure out why the function works fine given one input element, but not the other. Only difference is when the value is there. But, then the alert() function can get it just fine, why not the copyToClipboard() function? No different than the user typing into the textbox, right?