WEEK: 6

HTML Forms

HTML Forms Video

What are HTML forms? If you have ever purchased something online or filled out an application online or signed up for an email, your social media account, or more, you have filled out a form. Forms are just a way for us to gather data from the end-user. Keep in mind there are some principles to which we should adhere.

First, we want to adhere to standards. Use the component for their intended use. Use checkboxes for multiple selections and radio buttons for various choices, but only one correct one.

Aso, use dropdown lists, use those to control the input gathered. We are going to first focus on creating forms and what tags are required. Then, we will add a look and feel to them and add a little functionality to them.

Here is an example of a simple form.

<html>
    <head>
        <title>My first page</title>
    </head>
    <body>
        
        <form action="nextPage.html" type="Post">
            First Name: <input type="text" id="fName"><br>
            Last Name: <input type="text" id="lName"><br>
            <button id="mySubmit" type="submit">Submit</button>
        </form>
    </body>
</html>

See the Pen HTML Forms by Michael Cassens (@retrog4m3r) on CodePen.


Previous section:
Next section: