Getting started with Form hooks ############################### You can use Mautic's support for Form hooks to enhance or customize the Form experience when embedded into your third party websites. .. Note:: Form hooks are only supported when embedding Forms into your website manually or through the automatic methods. They don't work with iFrames. The first step is to embed the following JavaScript code once into the head of your website. The ``MauticFormCallback`` object contains the hooks for the named forms. .. code-block:: javascript if (typeof MauticFormCallback == 'undefined') { var MauticFormCallback = {}; } You can define hooks for multiple Forms using the API name of the Form as follows: .. code-block:: javascript MauticFormCallback['formname1'] = { // define hooks here }; MauticFormCallback['formname2'] = { // define hooks here }; .. Note:: Define the Form hooks somewhere in the DOM before the code that loads the Form. You'll need to view the HTML of the Form to find its API name. The easiest way to do this is to browse to the Form details in Mautic then click the 'Self-hosted' button. Look for the following in the second box: .. code-block:: html