In this recipe, we will create a simple HTML form that has two input fields and a button to submit the form. Perform the following steps:
- Create login-form.html inside the templates directory, as follows:
$ mkdir templates && cd templates && touch login-form.html
- Copy the following content to login-form.html:
<html> <head> <title>First Form</title> </head> <body> <h1>Login</h1> <form method="post" action="/login"> <label for="username">Username</label> <input type="text" id="username" name="username"> <label for="password">Password</label> <input type="password" id="password" name="password"> <button type="submit">Login</button> </form> </body></html>
The preceding template has two textboxes—username and password—along ...