Opening Caldera Forms Modals Using JavaScript

Caldera Forms Banner

Caldera Forms has an option to allow your forms to appear on the screen as a link or button and then open as a pop up modal. Those steps are outlined in our Getting Started guide here, under the section “Set As Modal.” This works automatically, requiring no additional code. If you would like to program some other way for the modal to open, besides clicking on the button or link, you can accomplish this using JavaScript.

Make sure to modify the data attribute being targeted with the correct form ID for your form. You can then bind this code to some other event of your choosing:

Caldera Forms modals use the Remodal library. See this section of the Remodal documentation for information on opening and closing modals.


Closing Caldera Forms Modals Using JavaScript