Streaming live at 10am (PST)

Execute script on button click


#1

Hi all,

Just wondering if I made a site and I wanted to execute a custom bit of script by clicking on a button how would I do that?

For example I would have a button in the middle of the screen that a user can click then the script runs (custom code).

Is it doable in Webfow?


Need help saving the contents of a div upon the click of a button
#2

Hello @Godweeno can you please provide an example of what you are looking to do?

I believe that you can do this, but it would only run on the published site & not in the design viewer.

Thank you,

Waldo smile


#3

Hey @Waldo I think we're thinking along the same lines, I had it running for a while in the manner you are explaining but I got rid of it for another solution. I was just hoping to use a Webflow placed button so it would work on an unpublished site for testing (and easier styling of the button).

Here is an example:
https://www.rezdy.com/book-now-button/

UPDATE:
Sorry I totally forgot to say click the 'BOOK NOW' button to see it working 😜


#4

Hey @godweeno just add in a div or link block and give it your button class, then style it to your hearts desire so you know what it'll look like when you use it in custom code. smile You could implement a modal?


#5

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.