How to save and retrieve form data with svelte

I am using framework7 svelte and would like to be able to save and get form data as described at Form Storage. However this does not seem to apply to svelte and I have failed to find an answer in the forum or the docs.

Thanks.

What did you try to do?

You can use f7 reference on page where you want to access form methods.

For example:

<Page>
  <form id="#myform">
    ...
    ...
    <Link on:click={getData}>Get</Link>
  </form>
</Page>
<script>
import {f7} from 'framework7-svelte';
function getData(){
  console.log(f7.form.getFormData("#myform"));
}
</script>

You can also use form reference by using svelte binding.

<form bind:this={form} />

May this will help you :slight_smile: