Lesson 4 of 55
HTMLForms Overview
9 min
Course progress7%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 4 of 55
HTML9 min
Keep these ideas in mind as you work through the lesson.
<form> ElementForms collect user input and submit it to a server.
<form action='submit.php' method='post' novalidate autocomplete='on'>
<!-- form controls go here -->
</form>
action – URL that receives the form data. If omitted, the form submits to the same page.method – GET (query string) or POST (request body). Use POST for sensitive data.novalidate – Disables the browser's built‑in validation, useful when you provide custom validation.autocomplete – on or off; guides browsers in offering previously entered values.enctype – Encoding type. Default is application/x-www-form-urlencoded. Use multipart/form-data for file uploads.autocomplete attribute thoughtfully – disable for passwords or one‑time codes.action points to a real endpoint? ✅method appropriate for the data being sent? ✅enctype set correctly for file uploads? ✅Tip: Provide a graceful fallback (
actionpointing to a real endpoint) for users who disable JavaScript.