Enable Modal Forms

  • Updated

Modal forms and forms that are generated dynamically with JavaScript may not be available when the Demandbase Tag initially loads. In these scenarios, Demandbase may attempt to identify and connect to a form before it exists on the page.

To ensure that Demandbase recognizes the form, call the following method after the form has fully rendered:

Demandbase.utils.loadFormModule();

This forces Demandbase to re-scan the page and initialize Forms Enrichment for the newly rendered form.

Important:

  • The field mappings for the modal or dynamically generated form must match the existing configuration for your primary form template.
  • Call Demandbase.utils.loadFormModule() only after the form has been completely rendered. If the method is called before the form exists in the DOM, Demandbase does not recognize the form.
  • By default, Demandbase supports a single form per page. If you need to enrich multiple forms on the same page (for example, a page form and a modal form), see Enrich Multiple Forms on One Page or the additional configuration and initialization logic required to support that use case.

Was this article helpful?

0 out of 0 found this helpful