First, you should use HTML5 validation attributes as much as possible, e.g.
<input type="number" min="0" max="5" required>
This will not allow the user to submit until their input is valid.
Apart from that, you can use localStorage to store inputs. But yes this is one of the advantages of using {{ formfield }}.