It would be a nice feature to have button or app or a easy way to code a button to copy a value from a text box to the clipboard. Right now it seems like it takes a page worth of code and an html box with code to do.
I second having this feature/be in the api. Looked up other forum responses to this topic and the code is fairly complicated to try to do yourself.
Explain the problem, please. Otherwise, the task seems very simple.
Let #text10 - The text you want to copy #text11 result and #button3 - button
Customize the response to the button.
export function button3_click(event) {
$w(‘#text11’).text = $w(‘#text10’).text
}
Result before clicking
After clicking
Not talking about copying to another text field. But hitting a button to copy and it appearing in the clipboard of the user so they can paste it somewhere else.
I can recommend the following method.
Create a collection in which to accumulate texts.
On the site, build a repeater, the text box which connect to the collection.
In the intermediate buffer, you can enter arbitrary information, and using the “copy” key you can initiate the addition of an entry to the collection.
Then everyone who is connected to your site at this time will see the new text.
Of course, every user can do the same. Now they can use clipboard to send information to their destination.
Creating a collection to have copy/paste seems like overkill. This should be a straight forward function.
This is super simple in regular javascript but we can’t use document.execCommand(“copy”) in Wix for some reason.
function myFunction() {
/* Get the text field */
var copyText = document.getElementById(“myInput”);
/* 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);
}
Surprisingly, the search for this direct function takes you a very long time - from Oct 28, 2018
Find - share.
Good luck!
Can someone from Wix comment on this? I’ve had nearly 25 users of my site complain that copying/pasting is too hard. Would love the simple copy to clipboard. Wix even has it on their own site for copying code.
Hi @tomorrowviral we already added copy and paste to our roadmap. We will update.
Shay
Hi Shay! It might be a bit early but do you have any updates about that?
Shay - any update here?
@shay Any update?
Any update on adding copy/paste, been 7 months, users been asking. Thank you.
Also interested. Any update?
When will this feature be available?
An update on copy/paste would be awesome, Shay! It’s been over a year for me since I started researching this. Looking forward to the feature being made available. Best, Ashley
@fordcreatv There is already a suitable workaround.
https://stcroppe.wixsite.com/steveonsoftware/example-code/wix-copy-text-to-clipboard
@deleteduser I’ve tried using that and it didnt work
@adozencookies Share your code and any relevant links to your site.