Forms on the web don't usually play nice with bad connections. If you try to submit a form while offline, you'll most likely just lose your input. Here's how we might fix that.
TL;DR: Here’s the CodePen Demo of this post.
With the introduction of Service Workers, developers are now able to supply experiences on the web that will work even without an internet connection. While it’s relatively easy to cache static resources, things like forms that require server interaction are harder to optimize. It is possible to provide a somewhat useful offline fallback though.
First, we have to set up a new class for our offline-friendly forms. We’ll save a few properties of the
... read the whole story at mxb.at.