The Action Attribute in HTML Forms: 16 MCQs
All 16 multiple-choice questions from this kit, free and with no sign-up.
Warm-up · 5 questions
Q1. What is the primary purpose of the `action` attribute on a `<form>` element?
BeginnerAnswers and explanations are in the Veda app.
Q2. A developer writes `<form action="/process.php" method="post">`. Where will the form data be sent?
BeginnerAnswers and explanations are in the Veda app.
Q3. If a `<form>` tag has no `action` attribute, what does the browser do on submission?
BeginnerAnswers and explanations are in the Veda app.
Q4. Which attribute works together with `action` to fully define a form submission?
BeginnerAnswers and explanations are in the Veda app.
Q5. The `action` attribute specifies the URL to which a form's data is submitted; if omitted, the browser submits to the current page's URL.
BeginnerAnswers and explanations are in the Veda app.
Building up · 6 questions
Q6. A student writes `action="submit"` expecting the browser to submit the form. What actually happens?
IntermediateAnswers and explanations are in the Veda app.
Q7. A login form has `action="http://example.com/login"`. What is the main security concern?
IntermediateAnswers and explanations are in the Veda app.
Q8. Which of the following is a legitimate use of an empty `action` (`action=""`)?
IntermediateAnswers and explanations are in the Veda app.
Q9. In the browser's form submission sequence, at which step does `action` participate?
IntermediateAnswers and explanations are in the Veda app.
Q10. A search form should produce results in the URL so users can bookmark them. Which pairing is best?
IntermediateAnswers and explanations are in the Veda app.
Q11. A form submits but the server returns a 404. What is the most likely cause?
IntermediateAnswers and explanations are in the Veda app.
Topper level · 5 questions
Q12. Which statement best explains why `action` and `method` are not interchangeable?
AdvancedAnswers and explanations are in the Veda app.
Q13. A developer builds an `action` URL from a query parameter without validation. What risk does this introduce?
AdvancedAnswers and explanations are in the Veda app.
Q14. A form on `https://shop.example.com/checkout` has `action="pay.php"`. To what full URL will the data be sent?
AdvancedAnswers and explanations are in the Veda app.
Q15. Which statement about `action` is correct?
AdvancedAnswers and explanations are in the Veda app.
Q16. A developer is creating a form with `action` set to a relative URL and `method` set to `POST`. The form is intended to submit user credentials to a secure server. However, the developer mistakenly leaves the `action` attribute empty. What is the most likely outcome of this error?
AdvancedAnswers and explanations are in the Veda app.
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