Skip to content

Saving incomplete form responses to LocalStorage and Pre-populating form #163

Answered by spinn
yuvi100 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

you could use the onAnswer or onStep events to catch when the user answers a question and then save your whole questions array to localStorage (or only the answers so as to not use too much storage space), and then when constructing the array, set the answer of the QuestionModel to your saved answer. This field is currently undocumented but I've opened issue #165 to make sure we document this in the future.

If you're setting the questions as components, simply set their v-model to whatever value you have saved in localStorage.

Example:

<template>
  <flow-form
    ref="flowform"
    v-on:step="onStep"
    v-bind:questions="questions"
  />
</template>

<script>
  export default {
    name:

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@spinn
Comment options

@yuvi100
Comment options

@spinn
Comment options

@yuvi100
Comment options

@spinn
Comment options

Answer selected by yuvi100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants