Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Form saver project template from

Project Details

Write a script that automatically saves a user's form inputs as they type and reloads them into the form when they come back to the page. Clear the saved data when the form is submitted.


  • Does each field need to be it's own entry in localStorage or can they all be saved as one item?
  • Should certain fields be excluded?
  • How can you structure the script so that you can add new fields without having to change your code?

Need help?

This project is part of the Browser Storage pocket guide and video course.

<!DOCTYPE html>
<title>Project Template</title>
<style type="text/css">
body {
margin-left: auto;
margin-right: auto;
max-width: 40em;
width: 88%;
textarea {
width: 100%;
label {
font-weight: bold;
textarea {
margin-bottom: 2em;
textarea {
height: 12em;
<h1>Form Saver</h1>
<form id="autosave">
<label for="name">Name</label>
<input type="text" id="name">
<label for="email">Email Address</label>
<input type="email" id="email">
<label for="notes">Notes</label>
<textarea id="notes"></textarea>
// Project code...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment