Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Using Toolset, displaying a View with a loop.
- HTML example:
- <input type="text" value="[types field='code'][/types]" id="DiscountCode-[types field='promotion-id' output='raw'][/types]">
- <button onclick="myFunction('DiscountCode-[types field='promotion-id' output='raw'][/types]')">Copy text</button>
- JS:
- function myFunction(textid) {
- /* Get the text field */
- var copyText = document.getElementById(textid);
- /* Select the text field */
- copyText.select();
- /* Copy the text inside the text field */
- document.execCommand("copy");
- /* Alert the copied text */
- alert("Copied the text: " + copyText.value);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement