Skip to content

formSubmit ​

suspense() ​

IMPORTANT

On this event its very important to notice that suspense function has to be implemented if you are listening to the event. it will take all functions (that returns a Promise) inside and waiting for them to resolve - it's required in the suspense function to have a minimum of 1 promise getting reolved or rejected!

type ​

typescript
function suspense(fn: () => Promise<void>): void

example ​

javascript
window.addEventListener('lf-sdk-ready', async () => {
  window.sdk.on('formSubmit', (e) => {
    e.suspense(async () => {
      await someAsynchronousAction();
    });
  });
});

formFields Array ​

A getter that returns the all the form fields in the registration form getting submitted.

example ​

javascript
window.addEventListener('lf-sdk-ready', async () => {
  window.sdk.on('formSubmit', (e) => {
        e.formFields.forEach((field) => {
          if(field.label === 'Name') {
            window.alert(field.value);
          }
        })
  });
});

section Object ​

A getter that returns the current section that unfolds content inside.

example ​

javascript
window.addEventListener('lf-sdk-ready', async () => {
  window.sdk.on('formSubmit', (e) => {
    window.alert(e.section.title);
  });
});

Interfaces ​

FormField ​

propertyaccesstype
idread onlynumber
labelread only`string
typeread only`string
valueread/write`string
validread/write`boolean

FlowPage ​

propertyaccesstype
idread onlynumber
titleread onlystring or undefined
formFieldsread onlyFormField[]
rowsread onlyRow[]

Row ​

propertyaccesstype
idread onlynumber
labelread onlystring or undefined
columnsread onlyColumn[]

Column ​

propertyaccesstype
idread onlynumber
labelread onlystring or undefined
addonsread onlyAddon[]

Addon ​

propertyaccesstype
aliasread onlystring
formFields**read onlyFormField