Calendly.initPopupWidget()
with your event URL.To trigger a Calendly popup widget using an onClick event on a Webflow button, follow this process using Calendly's official method. If it's not working, it's likely due to incorrect script placement or element targeting.
Go to Project Settings > Custom Code > Footer.
Paste the official Calendly embed script (from https://help.calendly.com) before the </body>
tag:
Calendly’s script:https://assets.calendly.com/assets/external/widget.js
Example:<script src="https://assets.calendly.com/assets/external/widget.js" type="text/javascript"></script>
Click Save and Publish your site (scripts work only on published sites).
On the page where the button lives, drag a “Embed” element from the Add panel.
Add the following inline script to open the Calendly popup:
```javascript
```
Replace the URL in 'https://calendly.com/your-username/your-event-name'
with your actual Calendly event link.
Select your Webflow button.
In the Element Settings panel, give it a unique ID or custom attribute.
Go to the Page Settings > Footer Code and add:
```javascript
```
Again, replace:
#your-button-id
with your button’s actual ID (set from Element Settings).
The Calendly URL accordingly.
To trigger a Calendly popup in Webflow: include Calendly's script in the Footer, add a custom script calling Calendly.initPopupWidget()
, and attach an onClick event to your button via script or inline HTML. Confirm it's all added correctly and test on a published site.