Need a copy url button using WYSIWYG buttons?
Posted: Sun May 15, 2022 11:14 pm
I need help with creating a copy url button using WYSIWYG buttons, is the Possible? Thanks
WYSIWYG Web Builder
https://www.wysiwygwebbuilder.com/forum/
https://www.wysiwygwebbuilder.com/forum/viewtopic.php?t=94838
Yes Please and thank youwwonderfull wrote: Mon May 16, 2022 11:23 am I already did a successful experiment for the copy url button in WWB and it is functioning absolutely perfectly. If you still need help understanding you can ask if any help needed.
Angelo wrote: Mon May 16, 2022 1:25 pmYes Please and thank youwwonderfull wrote: Mon May 16, 2022 11:23 am I already did a successful experiment for the copy url button in WWB and it is functioning absolutely perfectly. If you still need help understanding you can ask if any help needed.![]()
Code: Select all
<script>
function myFunction() {
/* Get the text field */
var copyText = document.getElementById("myInput");
/* Select the text field */
copyText.select();
copyText.setSelectionRange(0, 99999); /* For mobile devices */
/* Copy the text inside the text field */
navigator.clipboard.writeText(copyText.value);
/* Alert the copied text */
alert("Copied the text: " + copyText.value);
}
</script>
Did it work the way you wanted?
Yes it works Perfect. Is there also a way to copy URL without having the text box and have just the button?
Yes it works Perfect. Is there also a way to copy URL without having the text box and have just the button?
Thank you very much and do you have a site to where I can donate for your help?wwonderfull wrote: Mon May 16, 2022 2:11 pmYes it works Perfect. Is there also a way to copy URL without having the text box and have just the button?
I might have to do some experiment for that but yest it may be possible![]()
You can donate here https://www.buymeacoffee.com/wysiwygwbThank you very much and do you have a site to where I can donate for your help?
Code: Select all
<script>
function copyText() {
navigator.clipboard.writeText
("Change This Text With Your Link Your URL");
}
</script>
Code: Select all
<script>
function copyText() {
navigator.clipboard.writeText
("Change This Text With Your Link Your URL");
alert("URL Has Been Copied");
}
</script>
Which method did you try, was it the edit box one or just the button one? Share a demo file for further assistance ty.VictorKrs wrote: Mon May 16, 2022 9:07 pm Good evening! Unfortunately, the proposed solution does not work for me: (I can see I'm doing something wrongBut the "copying URL to clipboard" event itself seems to me worthy of attention. If Pablo adds this event to the standard functionality of the program, it would be great! As a development of the topic... when onclick is copied, not only the URL can be copied to the e-mail and not only for the button...
Good evening, Wonderful! Thank you for your help!wwonderfull wrote: Tue May 17, 2022 1:39 amWhich method did you try, was it the edit box one or just the button one? Share a demo file for further assistance ty.VictorKrs wrote: Mon May 16, 2022 9:07 pm Good evening! Unfortunately, the proposed solution does not work for me: (I can see I'm doing something wrongBut the "copying URL to clipboard" event itself seems to me worthy of attention. If Pablo adds this event to the standard functionality of the program, it would be great! As a development of the topic... when onclick is copied, not only the URL can be copied to the e-mail and not only for the button...
Good evening, Wonderful! Thank you for your help!
Link to the file of my failed project
https://cloud.mail.ru/public/crMJ/pZp84bFun
I will be grateful if you write what the error is!
Good evening!wwonderfull wrote: Thu May 19, 2022 7:45 amGood evening, Wonderful! Thank you for your help!
Link to the file of my failed project
https://cloud.mail.ru/public/crMJ/pZp84bFun
I will be grateful if you write what the error is!
Note: That the success happened when I copied and pasted the button, editbox and script on my WWB Project, the one you provided had issues.
The demo you gave me everything works absolutely perfect for me there was no problem on the script.
BUT...
When I publish it in my browser it previews in a different location which is file:///E:/Temp/WWBPreviewFiles/index.html
Make all the settings default and also use a new Untitled.wbs project and see if it works. The script has no problem at all, the preview location has problem; it even did not publish on my local publish folder. So I hope making everything default on the settings might fix everything.