Hi there. I have a 17Hats contact form link on my site that I want to turn into a popup window. 17Hats provide javascript for the popup, but is there a way to link it to a button on my site?
The javascript code is
<a class="sh_lead_button" href="https://xxxxxx.17hats.com/p#/lcf/hngkhxtgzbnpvgtgfwhhcfbdhbtppvbt" onclick="shLeadFormPopup.openForm(event)">Quick date check </a><script type="text/javascript" src="https://xxxx.17hats.com/embed/lead/script/hngkhxtgzbnpvgtgfwhhcfbdhbtppvbt"></script>
I’ve changed the login code to xxxx for security btw. Is there a stack or simple link I can use?
Any stack like our Button Press stack that allows you to add a link via RW’s built in links panel can be setup for you like this. (see attached). Just add the attributes to the link just as they appear in your code :
You would then place the script portion in the header area of either the page inspector or the site wide code, depending on where you want to use it, either on all pages or page by page.
Thank you very much for your answer. I’ve entered everything as shown into a rapid weaver link box. The link works but it opens in a new window rather than as a popup window…
Still no luck. The problem seems to be with the script being in the header section (I’ve tried the javascript section too but that fails also) as when I place the full link script on a page in an html frame it works fine (as a text link not a button), but when I place just the link and move the script to the header it fails to act as a popup.
If it’s in. An I frame it can’t leave the parent page. Only the page within the frame gets changed. I suspect this won’t be able to work the way you wanted.