Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

If you are a Web Form 2.0 customer who has stumbled upon this page, please navigate to the relevant pages: Embedded web form and Whitelabeling for Web Form 2.0

Integrating the finAPI Web Form Components

...

Alternatively, you can create a Javascript function to track and then dismount the component automatically once the status appears to be either aborted or completed. Here's an example:

Code Block
languagejs
    <script type="text/javascript">
        function autoDismount() {
            let interval = setInterval(function () {
                var tracker = document.querySelector("#web-form-status");
                if (tracker.value === 'ABORTED' || tracker.value === 'COMPLETED') {
                    console.info("Autodispatching the dismount event as the web-form's flow's been finished");
                    document.querySelector('web-form-element').dispatchEvent(new Event('dismount'));
                    clearInterval(interval);
                }
            }, 400)
        }
        autoDismount();
    </script>

...

Code Block
languagejs
   <script type="text/javascript">
       Object.defineProperty(document.getElementById('web-form-status'), "value", {
        set: function (newStatus) {
            if (newStatus === "COMPLETED" || newStatus === "ABORTED") {
                console.info("Autodispatching the dismount event as the web-form's flow's been finished");
                document.querySelector('web-form-element').dispatchEvent(new Event('dismount'));
            }
            return true;
          }
        });
    </script>

Web Form Components Customization

...