How frustating is for a user to re-type a field in a form when they accidentally close the page or reload the browser? Marcella is a js that saves user's form in the client browser preventing data loss.
- Add 'js-marcella' class to fields that you wanna to be saved
- Put marcella.js script (only 1kb) in your page
- Instantiate it, done!
<html>
<body>
.
.
.
<label>Email</label>
<input class="js-marcella" name="customerEmail" type="email">
.
.
.
<script src="marcella.js"></script>
<script>
new Marcella();
</script>
</body>
</html>
You can add a form selector when you instantiate Marcella to filter the fields inside the form only π€
.
.
.
<script src="marcella.js"></script>
<script>
new Marcella('#signup-form');
</script>
</body>
</html>
Download and run sample.html in your browser ππ½
This project is licensed under the MIT LicenseοΈ