Need a copy url button using WYSIWYG buttons?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
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
Post Reply
Angelo
 
 
Posts: 9
Joined: Wed Sep 09, 2020 8:51 pm

Need a copy url button using WYSIWYG buttons?

Post by Angelo »

I need help with creating a copy url button using WYSIWYG buttons, is the Possible? Thanks
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Need a copy url button using WYSIWYG buttons?

Post by Pablo »

What is a 'copy URL button'?
User avatar
BaconFries
 
 
Posts: 5327
Joined: Thu Aug 16, 2007 7:32 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by BaconFries »

wwonderfull
 
 
Posts: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

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
 
 
Posts: 9
Joined: Wed Sep 09, 2020 8:51 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by Angelo »

wwonderfull 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.
Yes Please and thank you :)
wwonderfull
 
 
Posts: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

Angelo wrote: Mon May 16, 2022 1:25 pm
wwonderfull 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.
Yes Please and thank you :)
Image

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>
Angelo
 
 
Posts: 9
Joined: Wed Sep 09, 2020 8:51 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by Angelo »

Thank you very much for your help
wwonderfull
 
 
Posts: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

Angelo wrote: Mon May 16, 2022 1:49 pm Thank you very much for your help
Did it work the way you wanted?
Angelo
 
 
Posts: 9
Joined: Wed Sep 09, 2020 8:51 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by Angelo »

wwonderfull wrote: Mon May 16, 2022 1:52 pm
Angelo wrote: Mon May 16, 2022 1:49 pm Thank you very much for your help
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?
wwonderfull
 
 
Posts: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

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 :D
Last edited by wwonderfull on Mon May 16, 2022 2:46 pm, edited 1 time in total.
Angelo
 
 
Posts: 9
Joined: Wed Sep 09, 2020 8:51 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by Angelo »

wwonderfull wrote: Mon May 16, 2022 2:11 pm
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 yest it may be possible :D
Thank you very much and do you have a site to where I can donate for your help?
wwonderfull
 
 
Posts: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

Thank you very much and do you have a site to where I can donate for your help?
You can donate here https://www.buymeacoffee.com/wysiwygwb

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>
Update: There is a way to do an alert on the browser the experiment was successful. Request if you need the alert function

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>
The editbox one seems better on my view but your wish :)
Angelo
 
 
Posts: 9
Joined: Wed Sep 09, 2020 8:51 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by Angelo »

Great work thanks again very much appreciate it!
User avatar
VictorKrs
 
 
Posts: 165
Joined: Sun May 17, 2020 8:08 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by VictorKrs »

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: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

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 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...
Which method did you try, was it the edit box one or just the button one? Share a demo file for further assistance ty.
User avatar
VictorKrs
 
 
Posts: 165
Joined: Sun May 17, 2020 8:08 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by VictorKrs »

wwonderfull wrote: Tue May 17, 2022 1:39 am
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 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...
Which method did you try, was it the edit box one or just the button one? Share a demo file for further assistance ty.
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!
wwonderfull
 
 
Posts: 1255
Joined: Fri Aug 21, 2020 8:27 am

Re: Need a copy url button using WYSIWYG buttons?

Post by wwonderfull »

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!
Image
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.
User avatar
VictorKrs
 
 
Posts: 165
Joined: Sun May 17, 2020 8:08 pm

Re: Need a copy url button using WYSIWYG buttons?

Post by VictorKrs »

wwonderfull wrote: Thu May 19, 2022 7:45 am
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!
Image
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.
Good evening!
Thank you for your help!
Post Reply