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>): voidexample
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
| property | access | type |
|---|---|---|
| id | read only | number |
| label | read only | `string |
| type | read only | `string |
| value | read/write | `string |
| valid | read/write | `boolean |
FlowPage
| property | access | type |
|---|---|---|
| id | read only | number |
| title | read only | string or undefined |
| formFields | read only | FormField[] |
| rows | read only | Row[] |
Row
| property | access | type |
|---|---|---|
| id | read only | number |
| label | read only | string or undefined |
| columns | read only | Column[] |
Column
| property | access | type |
|---|---|---|
| id | read only | number |
| label | read only | string or undefined |
| addons | read only | Addon[] |
Addon
| property | access | type |
|---|---|---|
| alias | read only | string |
| formFields** | read only | FormField |