Survey Form - Build a Survey Form

Tell us what’s happening:
Describe your issue in detail here.

I don’t understand what I did wrong with the code when I tried to solve with the hint: Your #name should have a placeholder attribute and value. Do I not have those?

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1 id="title">title</h1>
    <p id="description">desctiption</p>
    <form id="survey-form" select="dropdown">
      <input id="name" required>
      <input id="email" type="email" required>
      <input id="number" type="number" min="0" max="120">
      <fieldset>
        <label id="name-label">Name:<input id="name" type="text" placeholder="Enter your name" required /></label>
        <label id="email-label">Email:<input id="email" type="email" placeholder="Enter your Email" required /></label>
        <label id="number-label">Age:<input id="number" type="number" placeholder="Enter your age" required /></label>
    
/* file: styles.css */

Your browser information:

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

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

This is your #name input:

<input id="name" required>

I don’t see a placeholder attribute on it.

Update: Ahh, I see, you have two #name inputs. You can’t do that. Id’s need to be unique.

So I would need to remove id=“name” from the element?

Update: Like this?

 <h1 id="title">title</h1>
    <p id="description">desctiption</p>
    <form id="survey-form" select="dropdown">
      <fieldset>
        <label id="name-label">Name:<input id="name" type="text" placeholder="Enter your name" required /></label>
        <label id="email-label">Email:<input id="email" type="email" placeholder="Enter your Email" required /></label>
        <label id="number-label">Age:<input id="number" type="number" min="0" max="120" placeholder="Enter your age" required /></label>
    

No, your name input needs to have an id of name. You need to remove the duplicate inputs. In your original HTML you had duplicates for name, email and number.

I gotcha, I did that but for some reason the post wouldn’t let me put my original question asking exactly that. I got it to work, thank you very much for the help!

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