Book
Submodule 8.1: The HTML of forms
Submodule 8.1: The HTML of forms
Completion requirements
View
- role and creation of a form
- elements
- attributes
- accessibility
Form structure
The below code shows the basic structure of a form:
<form action="destination" method="get or post">
. . . form elements go here . . .
<input type="submit">
</form>
action="destination"
this defines the place where the data are going to be sent when the user clicks the submit button.method="get"
: the information sent to the server will be visible in the uRL fieldmethod="post"
: the information sent to the server as part of HTTP body; is not visible in the URL. Post is a better choice for keeping secrets<input type="submit">
: this defines a submit button (for submitting the form)
For more information: https://www.w3schools.com/html/html_forms.asp