0
0
HTMLmarkup~20 mins

Form submission basics in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Form Submission Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens when a form with method="post" is submitted?

Consider a form with method="post". What is the main difference in how data is sent compared to method="get"?

AData is sent in the URL query string, visible in the browser address bar.
BData is sent only if JavaScript intercepts the form submission.
CData is sent inside the HTTP request body, not visible in the URL.
DData is sent as cookies automatically by the browser.
Attempts:
2 left
💡 Hint

Think about where the data is placed in the HTTP request for POST vs GET.

📝 Syntax
intermediate
1:30remaining
Which form attribute correctly specifies where to send the form data?

In an HTML form, which attribute defines the URL where the form data is sent after submission?

Aaction
Benctype
Ctarget
Dmethod
Attempts:
2 left
💡 Hint

It usually looks like a URL or path.

rendering
advanced
2:30remaining
What is the visual result of this form code snippet?

Given this HTML form snippet, what will the user see in the browser?

HTML
<form action="/submit" method="get">
  <label for="email">Email:</label>
  <input type="email" id="email" name="email" required>
  <button type="submit">Send</button>
</form>
AA form with an email input but no label visible.
BA form with a text input box labeled 'Email:' and a button labeled 'Send'. The input accepts any text.
CA form with no visible input fields but a 'Send' button.
DA form with an email input box labeled 'Email:' and a button labeled 'Send'. The email input requires a valid email before submission.
Attempts:
2 left
💡 Hint

Look at the type and label elements.

selector
advanced
2:00remaining
Which CSS selector styles only the submit button inside a form?

You want to style only the submit button inside any form on the page. Which CSS selector achieves this?

Aform button[type="submit"]
Bbutton.submit
Cform > button
Dinput[type="submit"]
Attempts:
2 left
💡 Hint

Look for a selector that targets buttons with a specific attribute inside forms.

accessibility
expert
3:00remaining
What is the best way to make a form accessible for screen readers?

Which practice improves accessibility for screen reader users when filling out forms?

AUse placeholder text inside inputs instead of labels to save space.
BUse <code>label</code> elements properly linked to inputs with <code>for</code> and <code>id</code> attributes.
CUse only color changes to indicate required fields without text.
DHide labels visually but do not link them to inputs.
Attempts:
2 left
💡 Hint

Think about how screen readers identify form fields.