Digital business card/Share 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
User avatar
wwonderfull
 
 
Posts: 1584
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Digital business card/Share buttons

Post by wwonderfull »

thisazlife wrote: Sun Sep 24, 2023 11:04 pm Thank you, I've actually been to those sites! The issue is that I'm not a coder so I struggle to figure it all out but I'll give it a try. It would be nice to see WWB at some of these features.
I did it before here is a solution that I had provided viewtopic.php?t=94838&hilit=copy

If you need help then send me an email as I have already done this before. You can contact me using my website signature below.
thisazlife
 
 
Posts: 71
Joined: Mon Apr 24, 2017 4:19 am
Location: Chandler, AZ USA
Contact:

Re: Digital business card/Share buttons

Post by thisazlife »

wwonderfull wrote: Mon Sep 25, 2023 3:07 am
I did it before here is a solution that I had provided viewtopic.php?t=94838&hilit=copy

If you need help then send me an email as I have already done this before. You can contact me using my website signature below.
[/quote]

Thank you. I actually found some code I like and I can get it to work if I add to HTML from WWB Toolbox but I'd really like to add the html/js to a button so it matches my others, is there a way to add html/js to a button? I dont' see it.

Also I like this idea of grabbing the URL but if I wanted to hvae a button always copy to clipboard a specific URL link, how would I change the code below to hardcode a URL?

-------------------------
<!DOCTYPE html>
<html>
<body>

<button onclick="copyToClipboard()">Copy URL Link to Share style="display:inline-block;width:269px;height:40px;z-index:6;">Copy URL Link to Share</button>
<script>
function copyToClipboard(text) {
var inputc = document.body.appendChild(document.createElement("input"));
inputc.value = window.location.href;
inputc.focus();
inputc.select();
document.execCommand('copy');
inputc.parentNode.removeChild(inputc);
alert("URL Copied.");
}
</script>

</body>
</html>
Steve Colbeth
Arizona Real Estate Agent / Consultant
http://stevecolbeth.com
me@stevecolbeth.com
Chandler, Arizona - USA
User avatar
Pablo
 
Posts: 23434
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Digital business card/Share buttons

Post by Pablo »

You can add custom code via the HTML tools: https://wysiwygwebbuilder.com/add_html.html

You can add an onclick to a button even via 'Events'
thisazlife
 
 
Posts: 71
Joined: Mon Apr 24, 2017 4:19 am
Location: Chandler, AZ USA
Contact:

Re: Digital business card/Share buttons

Post by thisazlife »

UPDATE: So gave it a try, I"ll look at it again but doesn't seem to work as I thought it did from your last comment.
If I add the js script to my button via object html, inside the Tag, removing doc type and body I can't figure out how the onclick calls the object html.
Steve Colbeth
Arizona Real Estate Agent / Consultant
http://stevecolbeth.com
me@stevecolbeth.com
Chandler, Arizona - USA
User avatar
Pablo
 
Posts: 23434
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Digital business card/Share buttons

Post by Pablo »

It works, if you do it the correct way:
1. Add the JavaScript function between the head tags.
2. Add the function call in the event
thisazlife
 
 
Posts: 71
Joined: Mon Apr 24, 2017 4:19 am
Location: Chandler, AZ USA
Contact:

Re: Digital business card/Share buttons

Post by thisazlife »

Pablo wrote: Mon Sep 25, 2023 7:11 am It works, if you do it the correct way:
1. Add the JavaScript function between the head tags.
2. Add the function call in the event
OK, I added the script to object html
I go to the button > events > add > onclick?? I don't see function call. I see onclick javascript but doesn't seem to be a way to add my js.

UPDATE: I think I got it! I added the fuction for button onclick into the code and put it just before the script. Seems to be working!
Steve Colbeth
Arizona Real Estate Agent / Consultant
http://stevecolbeth.com
me@stevecolbeth.com
Chandler, Arizona - USA
thisazlife
 
 
Posts: 71
Joined: Mon Apr 24, 2017 4:19 am
Location: Chandler, AZ USA
Contact:

Re: Digital business card/Share buttons

Post by thisazlife »

I got it!
Here it is, my eCard: https://ecard.thisazlife.com
Thanks everybody for your input!
Steve Colbeth
Arizona Real Estate Agent / Consultant
http://stevecolbeth.com
me@stevecolbeth.com
Chandler, Arizona - USA
Post Reply