Need a copy url button using WYSIWYG buttons?
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Need a copy url button using WYSIWYG buttons?
I need help with creating a copy url button using WYSIWYG buttons, is the Possible? Thanks
Re: Need a copy url button using WYSIWYG buttons?
What is a 'copy URL button'?
- BaconFries
-
- Posts: 5923
- Joined: Thu Aug 16, 2007 7:32 pm
- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
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.
Re: Need a copy url button using WYSIWYG buttons?
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.

- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
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.![]()

Take an editbox rename the ID to myInput Go to button properties and then check read only and in the value give your own URL as I have given https://example.com you give your url
then take a button go to events of the button and on click select javascript then paste
myFunction()
after select that button go to Object HTML and go to Custom Style and paste the below code
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>
Re: Need a copy url button using WYSIWYG buttons?
Thank you very much for your help
- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
Did it work the way you wanted?
Re: Need a copy url button using WYSIWYG buttons?
Yes it works Perfect. Is there also a way to copy URL without having the text box and have just the button?
- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
Yes 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 yes it may be possible

Last edited by wwonderfull on Mon May 16, 2022 2:46 pm, edited 1 time in total.
Re: Need a copy url button using WYSIWYG buttons?
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![]()
- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
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?
and for your button
Take a button go to events of the button and on click select javascript then paste
copyText()
Select the button go to Object HTML go to custom styles paste the code written below "Change This Text With Your Link Your URL" change this text with the url you want and its done. It does not alert but it does copy the text.
Code: Select all
<script>
function copyText() {
navigator.clipboard.writeText
("Change This Text With Your Link Your URL");
}
</script>
For the SImple Alert on Browser You can use this script instead
"URL Has Been Copied" You can put any text there
Code: Select all
<script>
function copyText() {
navigator.clipboard.writeText
("Change This Text With Your Link Your URL");
alert("URL Has Been Copied");
}
</script>

Re: Need a copy url button using WYSIWYG buttons?
Great work thanks again very much appreciate it!
Re: Need a copy url button using WYSIWYG buttons?
Good evening! Unfortunately, the proposed solution does not work for me: (I can see I'm doing something wrong
But 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...

- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
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...
Re: Need a copy url button using WYSIWYG buttons?
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...
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!
- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Need a copy url button using WYSIWYG buttons?
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!

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.
Re: Need a copy url button using WYSIWYG buttons?
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.
Thank you for your help!