Read the following tutorial:

Web forms — Working with user data[MDN]

In the above tutorial here are the required and optional sections to read:

Most of the the lab will be oriented around this last tutorial. It is strongly recommended that you try all the examples in it yourself rather than just reading about them.