In the example below, form validation is used to check that a username and password that is submitted is not empty (the user must enter something for both the username and password). It will not actually check if the username and password is correct though (that requires some server-side processing and a database – if we want to have a secure form).
Watch the video below and then scroll down to see the code.
Here is the code for the submission.html page (‘thank you’ page) the user sees after the form has been submitted:
Next tutorial: Radio buttons and form validation