Debug a Donation Form - Debug a Donation Form

Tell us what’s happening:

Debug a Donation Form: 11. You should associate every input element with a label element using the for and id attributes.

I’m unable to see why I can’t pass this part of the debugging workshop - please help.

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="fullName" id ="fullName">Full Name:</label>
    <input id ="fullName" type="text" name="name" required>

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

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

    <label for="newsLetter" id="newsLetter">Subscribe</label>
    <input id="newsLetter" type="checkbox" name="newsletter">
    Subscribe
    
    <label for="submit" id="submit">Submit</label>
    <input type="submit" value="Send">
  </form>
</body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15

Challenge Information:

Debug a Donation Form - Debug a Donation Form

There is a typo too in one of your Label Id.
And the word “Subscribe” appears twice in the code.

Also, I try to pass test 3. but no luck.

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

An id must be unique. You cannot use the same id for more than one element.

You have 5 label elements, not 4 labels as stated in failed Test #3. The input element with type=“submit” does not actually accept user input.

Test 3. - I have found out, the user stories doesn´t require you to make a Label for the submit button.

you can’t give the same id to multiple elements

You should remove the id from the label, and make sure the id is on the input element and matches the name attribute.

It is telling me “your checkbox input should not have a required field”

Heres my code, can anyone tell me what’s wrong?

Donation Form

Donation Form

<label for="name">Fullname:</label>

<input type="text" id="name" name="name" required>







<label for="email">Email Address:</label>

<input type="email" id="email" name="email" required>







<label for="amount">Donation Amount ($):</label>

<input type="number" id="amount" name="amount" required>



<label for="subscribe">

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



</form>



<input type="submit" value="Send">

Welcome to the forum @Dave20!

Please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Help button image located on each challenge. This will automatically import your code in a readable format and pull in the challenge URL while still allowing you to ask any question about the challenge or your code.

Thank you.

Happy coding!