The Action Attribute in HTML Forms: 20 flashcards
All 20 flashcards from this kit, free and with no sign-up.
1. What does the `action` attribute specify in an HTML form?
Show the answer
The URL where the form data is sent when the form is submitted.
2. Where is the `action` attribute written?
Show the answer
On the opening `<form>` tag.
3. What happens if the `action` attribute is omitted?
Show the answer
The browser submits the form to the current page's URL by default.
4. What are the three common types of values for `action`?
Show the answer
Absolute URL, relative URL, or empty/omitted (submits to current page).
5. Does `action` determine the HTTP method used to send data?
Show the answer
No. The `method` attribute (GET or POST) determines how data is sent; `action` only sets the destination.
6. What does `action="submit"` actually do?
Show the answer
The browser treats `submit` as a relative URL and tries to navigate to a page named `submit`, which usually results in a 404.
7. How is a relative `action` URL resolved?
Show the answer
It is resolved against the page's base URL to form a full address before the request is sent.
8. What is the security concern with an `action` URL starting with `http://`?
Show the answer
Data is sent in plain text and can be intercepted; sensitive forms should use `https://`.
9. Why is an empty `action` (`action=""`) sometimes used intentionally?
Show the answer
It is a legitimate pattern for pages that both display and process a form, submitting back to the same page.
10. What typically happens if the `action` URL points to a non-existent page?
Show the answer
The server returns a 404 response rather than a silent failure.
11. In the form submission sequence, at which step does `action` participate?
Show the answer
The resolve step, where the browser resolves the action URL against the base URL before sending.
12. Which attribute works together with `action` to fully define a form submission?
Show the answer
The `method` attribute (GET or POST).
13. What is the safe default for `action` when no third-party service is needed?
Show the answer
Keep it on the same origin (same site) and use HTTPS.
14. Name three real-world forms that rely on `action` to route data.
Show the answer
Login, signup, search, payment, contact forms (any three).
15. What should you check first if a form appears to do nothing when submitted?
Show the answer
Check the submit button, then the `action` URL, then the `method` attribute, in that order.
16. Does `action` validate form input?
Show the answer
No. Validation is handled by HTML attributes like `required`, `pattern`, or JavaScript; `action` only sets the destination.
17. What is the role of `action` in the front-end/back-end handoff?
Show the answer
It is the handoff point: the browser sends data to the URL specified by `action`, where a server-side script (PHP, Node.js, Python, Java) processes it.
18. Which method pairs well with a search form, and why?
Show the answer
`method="get"` pairs well because data appears in the URL and is bookmarkable.
19. Which method pairs with `action` for state-changing or sensitive submissions?
Show the answer
`method="post"` is used for signups, orders, and other state-changing or sensitive submissions.
20. What risk arises if an `action` URL is built from untrusted input?
Show the answer
An attacker could redirect form submissions to their own server, potentially stealing data.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Paper Solver
Get Veda free See what students get
Free to start · Android app and web · More than 40 languages