Popup window needed


(Chris Loneragan) #1

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?

Thanks

Chris


(Chris Loneragan) #2

Any ideas anyone? I need to turn the text link in the above script into a button…


(Jason Bostick) #3

Focus by Elixir might work http://rapidweavercommunity.com/addons/stacks/focus
or maybe Top Box by Will Woodgate https://stacks4stacks.com/topbox/

Will’s stacks all have demos that you can try. He may have other solutions if you browse his stacks but TopBox seems like it would fit…


(Jan Fuellemann) #4

A buttons stack from @Doobox? Look at https://www.doobox.co.uk/stacks_store/demos/buttonpresstwo.html


(Doobox Software) #5

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.

<script type="text/javascript" src="https://xxxx.17hats.com/embed/lead/script/hngkhxtgzbnpvgtgfwhhcfbdhbtppvbt"></script>


(Chris Loneragan) #6

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…


(Doobox Software) #7

Try switching the value of the onclick event in the links panel from :

shLeadFormPopup.openForm(event)

to:

return shLeadFormPopup.openForm(event);

It really depends on how the script your loading is set to respond though.


(Chris Loneragan) #8

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.

Thanks for trying so far :slight_smile:


(Doobox Software) #9

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.


(Chris Loneragan) #10

I think so too. Very annoying though :frowning: - your help was much appreciated :slight_smile: