Loading...
HTML Form Attributes
The form tag accepts attributes that change submission behavior. Master action and method first, then useful extras.
Direct answer
action— URL that receives the datamethod— usuallyget(query string) orpost(request body)autocomplete— allow/deny browser autofill hints (on/off)novalidate— skip built-in HTML field checks on submit (use carefully)
📊 Common form attributes
| Attribute | Role |
|---|---|
| action | Submission destination URL |
| method | get or post |
| autocomplete | Autofill behavior hint |
| novalidate | Disable built-in field checks for that submit path |
| name / id | Identify the form element itself |
Form attributes in practice
html
HTML Code
<form
id="contact"
action="/contact"
method="post"
autocomplete="on">
<label for="name">Name</label>
<input id="name" name="name" type="text">
<button type="submit">Send</button>
</form>
Try it
- Build a small form with
method="get"and watch the query string after submit (even if the page 404s) - Switch to
method="post"and compare - Toggle
autocomplete="off"on a practice field set - Note when you might use
novalidateonly for special demos
Easy mistakes
- Empty
actionwithout understanding it submits to the current URL - Sending passwords with
get(visible in URLs/logs) - Disabling field checks with
novalidatepermanently in production demos
Summary
action+methodare core- Prefer
postfor private or large data autocompleteandnovalidateare optional tools- Name forms when scripts need them
🧠 Test Your Knowledge
Ready to Start
Test Your Knowledge
Challenge yourself with this interactive quiz and see how well you understand the topic
5
Questions
70%
To Pass
∞
Time
∞
Attempts
📝 Instructions
- Read each question carefully
- Select the best answer for each question
- You can retake the quiz as many times as you want
- Your progress will be shown at the top