Form data persistency
The stock runners have a built-in feature to maintain form state persistency. This feature allows respondents to leave an HTML page that contains a form and later return to it. The form restores to the same state right before the respondent left. This feature can be useful, for example, when you have embedded a chat runner on multiple (or all) pages of your website and you want to maintain the runner state between page jumps.
☝️ How it works
The persistency feature uses the locale storage of the browser to store the snapshot when the respondent navigates away from the page that hosts the runner. When a respondent returns to the page, the stored snapshot is fed back to the runner, and the form state is restored.
✅ Activating it
To enable data persistency, you only have to supply the persistent
property to the run
function and set it to true
.
- Autoscroll
- Chat
- Classic
import { run } from "@tripetto/runner-autoscroll";
run({
definition: /* Supply your form definition here */,
persistent: true
});
import { run } from "@tripetto/runner-chat";
run({
definition: /* Supply your form definition here */,
persistent: true
});
import { run } from "@tripetto/runner-classic";
run({
definition: /* Supply your form definition here */,
persistent: true
});
📖 Reference
- Autoscroll
- Chat
- Classic
Have a look at the complete autoscroll runner API reference for detailed documentation. In the examples above, the following symbols were used:
Have a look at the complete chat runner API reference for detailed documentation. In the examples above, the following symbols were used:
Have a look at the complete classic runner API reference for detailed documentation. In the examples above, the following symbols were used: