How to Bind the Popup Form to Other Elements on the Page
By default, when you use the embed code to add a popup form to your website, the code also adds a link which triggers the popup on click. What if you want to trigger the popup form when you click on an existing element on the page, like an image?
For Regular Sites
Your embed code for a popup form looks like this:
The part highlighted in blue is your unique binding ID. Now, we want to trigger this popup form when user clicks a certain image on the page. The html code for this image is:
To bind the form to this image, we change the html code of the image to this
We altered the image code to add two attributes. The data-target attribute contains our unique binding ID, preceded by #, and the data-toggle attribute contains the string fcmodal.
For WordPress Sites
Firstly, add the embed code for a popup form to your post / page
The ID of our form is 123. We wish to trigger the popup form when the user clicks a button. To achieve this, we set the href attribute of the button to this:
Our final button could would be something like this: