jfquestiaux
Well-Known Member
I'd like to use for the first a button element to copy the content of a textarea (generated by a calc element) to the clipboard.
I found a simple JS that does that in a way that suits me (without Flash), even though it may look old fashioned (if somone knows a better way, without Flash, I'm open for it), but I have two problems for which I need help:
I found a simple JS that does that in a way that suits me (without Flash), even though it may look old fashioned (if somone knows a better way, without Flash, I'm open for it), but I have two problems for which I need help:
- I pasted the code into the JS box in the JS tab of the button element as illustrated in pic1, but when I save, \ get added before the ' (pic2), which gives me a JS error:
Erreur : SyntaxError: illegal character
Fichier Source : http://www.euf.eu.com/trans/media/com_fabrik/js/element-min.js
Ligne : 1, Colonne : 50
Code Source :
function copyToClipboard (text) { window.prompt (\'Copy to clipboard: Ctrl+C, Enter\', text);}
- When the \ issue will be resolved, what should I put to replace 'text' by the actual content of my textarea, knowing that its id is '___term'?