Debug a Donation Form - Debug a Donation Form

Tell us what’s happening:

im done debugging but it keeps saying input should have required attribute

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Donation Form</title>
  </head>
  <body>
    <h1>Donation Form</h1>
    <form>
      <label for="name">Full Name:</label>
      <input type="text" id="name" required>

      <label for="email">Email Address:</label>
      <input type="email" id="email" required>

      <label for="amount">Donation Amount ($):</label>
      <input type="number" id="amount" name="amount" required>

      <input type="checkbox" id="newsletter" name="newsletter">
      <label for="newsletter">Subscribe</label>

      <input type="submit" value="Send">
    </form>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36

Challenge Information:

Debug a Donation Form - Debug a Donation Form

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-debug-donation-form/690ddb5e6ee94eb73ed172b0.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @olowo-eko!

Why did you remove the name attributes from the first two input elements?

You may want to reset this challenge and try again.

Happy coding!

Here’s a forum-friendly version—shorter, clearer, and conversational:


Title: Possible Bug in “Debug a Donation Form” Exercise (Tests 2 & 3 Conflict)

Hi everyone,

I think I’ve run into a bug in the “Debug a Donation Form” exercise and wanted to check if others have experienced the same.

The issue seems to be a conflict between these two test requirements:

  • Test 2: You should have exactly five input elements in your form.

  • Test 3: You should have exactly four label elements in your form.

At the same time, the instructions suggest that each input should be associated with a label.

What’s happening

  • If I create 5 inputs and 5 labels (one per input), Test 3 fails.

  • If I reduce it to 4 labels to pass Test 3, then it no longer properly matches all inputs, and other checks fail.

So basically, fixing one test breaks the other.

Question

Is this an issue with the tests, or am I misunderstanding the requirement for labeling inputs in this exercise?

Would appreciate any clarification or confirmation from others :folded_hands:

Thanks!

Welcome to the forum @elydyaz!

There is no bug and this topic already has a solution. If you need help, please create your own topic. Thank you.

Happy coding!