App Academy

Need help - "pet_name" input and associated label

Hey everyone,

I’ve dug through the forums and see people have had similar issues but haven’t seen a resolution.

I got 10/12 on my first attempt and was able to quickly fix one of the issues (the media query) but for the life of me I can’t seem to figure out how to address:

has exactly one input with a name of ‘pet_name’ and an associated label with the content 'Name’

This is my work:

<body>
Name Type Cat Dog Hamster Zebra Other Biography Owner's Email Create new pet Reset

I think it might be an issue from the space after “pet_name” and the /> in “…name=“pet_name” />” but I got confirmation that wouldn’t be a problem from a resource.

Thanks!

Can you repost your code in a code block or post an image? It looks like it didn’t render correctly, so we can’t see your details.

Oh thanks! Here you are.
pet_name issue

Oh, this is a tough one. It took awhile to see what was going on! You’re correct that your pet_name label and input look fine - that space is not an issue at all.

However, double check the rest of the labels and associated inputs on your form. It looks like this test failed because of how you associated one of the other labels.

Thanks so much for the response!

If possible, does that mean I only have one label with “name”?

Does this look better or am I off track? =)

Yes, you should only have one label for “name”. Looks like you found it!

Ugh I resubmitted and got the same feedback.

You’re so close. You changed the for field in the label for the email, but it needs to be associated with the email input field. Double check how you associated labels with inputs with the other two inputs, and you will see what you need to do to fix it. You’ve got this!

Hey @jbyers! Would you mind checking this code? Looks like I am having the same issue. Here’s the code:

    <label for="Name">Name</label>
    <input type="text" name="pet_name" id="Name">

    <label for="type">Type</label>
    <select name="pet_type" id="type">
      <option value="Cat">Cat</option>
      <option value="Dog">Dog</option>
      <option value="Hamster">Hamster</option>
      <option value="Other">Other</option>
      <option value="Zebra">Zebra</option>
    </select>

    <label for="bio">Biography</label>
    <textarea id="bio" name="pet_bio"></textarea>

    <label for="owner-email">Owner's Email</label>
    <input type="email" name="pet_owner_email" id="owner-email">

    <button type="submit" id="new-pet-submit-button">Create new pet</button>

    <button type="reset">Reset</button>
  </form>

@jbyers It looks like when you said it was correct to the other post the code looked like this:

Name

Or is there an error in a different part of the code?

Thanks!

  • Will