Skip to content

Aliveforms Plugin Template

In Aliveforms, plugins can be created using JavaScript logic. A plugin is a logic module that can extend the capabilities of Aliveforms using JavaScript API.

Setup

Ideally, a plugin shall be only for Screen -1 and from here it shall be able to use Event Handlers. A plugin can use custom properties as mean of input. A plugin can also be designed in a way, it can be configured or extended using inline logic in form.

A plugin can be IIFE.

(function() {
  let frm = $.HackForm();
  let len = frm.length;

  for (let i = 0; i < len; i++ ){
    let scr = frm[i];
    if (scr?.customProps?.handle_alert) {
      let msg = scr?.customProps?.msg ?? '';
      $.Handle(`screen_${i}_on_enter`, function() {
        $.Alert(msg);
      });
    }
  }
})()
A plugin can also be implemented as

  window.MyDemoPlugin = function() {

  }

then, in form inline logic, or module it can be called window.MyDemoPlugin().