Issues with survey form test

Hello there!

I really need help with this.

I’m doing the test for the survey form and I’m stuck in the following error: “All checkboxes should have a value attribute and a value.” However, I have a value that the test won’t accept. It accepts the same syntax for the radio button, but not for checkboxes. I tried adding name, id, what have you, and I still can’t make it.

Now, I found someone on YouTube who has passed this particular task. I copied their checkbox code and I still don’t pass it. How is that possible? I ran this code through a LOT of places. it passes the validation.w3, but won’t pass this test.

Please please please help me. It’s been days since I’ve been stuck in this.

Here’s the code I copied: <

Here’s my exact code:

Please post your full code (and not as screenshots). Thanks

1 Like

Hi Jeremy! Thanks for your reply.
Here’s the whole code. I passed all tests except this one. Thank you!

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Job Application Form</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="styless.css">
  </head>

  <body>
    <h1 id="title">Job Application Form</h1>
    <p id="description">Please fill out the form with your personal details and work experience.</p>

    <form id="survey-form" method="post" action="https://example.com">

  <fieldset>
   <label id="name-label" for="name">Full name: </label><input id="name" type="text" name="name" required placeholder="John Smith">
 </fieldset>
<fieldset><label id="number-label" for="number">Date of birth: </label><input id="number" type="number" name="number" required min="4" max="8" placeholder="10.1.90">
</fieldset>
<fieldset><label id="email-label" for="email">Your email</label><input id="email" type="email" name="email" required placeholder="example@email.com"></fieldset>

<fieldset>
  <legend>Choose the position you're applying for:</legend>
  <label for="freelancer"><input type="radio" id="freelancer" name="choice" value="freelancer"> Freelance Translator</label>
  <label for="data"><input type="radio" id="data" name="choice" value="data"> Data Analyst</label>
  <label for="project"><input type="radio" id="project" name="choice" value="project"> Project Manager</label>

  <label for="soft"><input type="radio" id="soft" name="choice" value="soft"> Software Engineer</label>
</fieldset>

<fieldset>
  <legend>Are you willing to relocate?</legend>
  <label><input type="checkbox" value="checkbox1"> Relocate within the USA</label>

  <label><input type="checkbox" value="checkbox2"> Canada</label>
 
</fieldset>

<fieldset>
  <legend>Please briefly describe your work experience:</legend>
  <textarea id="work-exp" rows="5" cols="50" placeholder="Describe your work experience"></textarea>
</fieldset>

<fieldset>
   <label for="cv-upload">Please upload your CV: <input type="file" id="cv-upload">
 </label>
</fieldset>

<fieldset>
 <label for="drop-down">How did you hear about us?</label>

<select id="dropdown" name="drop-down" required>
  <option value="" disabled selected>Choose</option>
  <option value="option1">Google</option>
  <option value="option2">LinkedIn</option>
  <option value="option3">FlexJobs</option>
  <option value="option4">Gumtree</option>
  <option value="option5">Other</option>
</select>
</fieldset>

<fieldset>
  <label for="terms-conditions"><input type="checkbox" id="terms-conditions"> I accept the my data will be stored safely.</label>
</fieldset>

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

</form>
</body>
</html>

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like

it’s not an answer to your question, but while looking at things this appeared. You have a mismatch between id and for attribute, they need to match.

Here,

this, a checkbox without a value attribute

1 Like

Oh, my lord! Ilenia, I so much appreciate you! I feel so dumb right now. Thanks a lot! I understand the first issue with the id + for attribute. I will fix that too. Thanks so so much for your help!

Thank you, Jeremy! I will keep that in mind for the next one!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.