Learn Form Validation by Building a Calorie Counter - Step 9

Tell us what’s happening:

everything looks good but i get this error message at the end

Conditons

In your span element, create a label element for an entry-dropdown and give it the text Add food or exercise:. Then create a select element with the id set to entry-dropdown and a name set to options. Below that, add a button element with the id set to add-entry and the text Add Entry.

Give your button element a type attribute set to button to prevent automatic form submission.

Your code so far

          <div class="controls">
            <span>
              <label for='entry-dropdown'>Add food or exercise:</label>
              <select id='entry-dropdown' >
                <option value='options'>name</option>
              </select>
              <button type='submit' id='add-entry'>Add Entry</button>
              <label for='entry-dropdown'>Add food or exercise:</label>
              <select id='entry-dropdown' name='options'></select>
              <button type='button' id='add-entry'>Add Entry</button>
            </span>
          </div>


###Error
Your new select element should have a name attribute set to options

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 9

Why did you create two buttons, two selects and two labels?

1 Like

I deleted them but the same error appears

It appears that the interpreter is reading a different line than the one you intend it to. Read over your code and check that the correct instance of select element has all needed attributes.

1 Like

Post your new code, so we can see what the problem may be.

Did you delete the correct ones :slightly_smiling_face:

1 Like

Thx it’s working now

You was right, error came from interpreter

1 Like

Awesome. Do you mind making my reply the solution? It can help others if they run into the same problem in the future.

Just to be clear, the error was not with the tests. It was due to the fact that you added duplicate elements. In the future, be sure to only do what the instructions ask for an no more and you won’t run into these problems.

1 Like

thx, i’ll be careful in the future

1 Like

Yep! The duplicate elements are completely unnecessary, and could potentially lead to problems down the line. Definitely always follow the instructions and double check your work for small errors like this.