HTML Forms Introduction
Understand form, label, input, button, and form submission.
Category: HTML | Lesson: 11 of 40
What is a form?
Forms collect information. The form element groups controls and defines how data is submitted.
Basic form
<form action="/contact" method="post">
<label for="full-name">Full name</label>
<input id="full-name" name="fullName" type="text">
<button type="submit">Send</button>
</form>
Attributes
- action: destination that receives the submission.
- method: commonly get or post.
- name: key used when submitting a control's value.
- id: identifier used by label and scripts.
- required: requires a value before browser submission.
HTML alone does not store or email submissions. A server or form handler must process the data.
GET and POST
GET places data in the URL query string and suits searches. POST sends data in the request body and commonly suits state-changing submissions. Use HTTPS for both.
Practice
Create a labeled contact form with name, email, message, and submit button.
Want to learn this professionally?
Explore practical IT training at Cyber Code Academy.
View Academy Courses