# Learn Form Validation by Building a Calorie Counter - Step 45

**URL:** <https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-45/681963>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [March 25, 2024, 1:57am UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-45/681963 "2024-03-25T01:57:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel.moreira](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/daniel.moreira/32/357916_2.png) [@daniel.moreira](https://forum.freecodecamp.org/u/daniel.moreira)\
**Post date:** [March 25, 2024, 1:57am UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-45/681963/1 "2024-03-25T01:57:59Z")

</div>

### Tell us what’s happening:

```auto
function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
  const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
  const HTMLString = `<label for="${entryDropdown.value}-${entryNumber}-name">Entry ${entryNumber} Name</label>`;
}

```

What is wrong? does not seem to be working.

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

````plaintext
Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

````

### Your browser information:

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

### Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 45

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-form-validation-by-building-a-calorie-counter/step-45)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![bbsmooth](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bbsmooth/32/203556_2.png) [@bbsmooth](https://forum.freecodecamp.org/u/bbsmooth)\
**Post date:** [March 25, 2024, 2:25am UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-45/681963/2 "2024-03-25T02:25:52Z")

</div>

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.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [March 25, 2024, 4:44am UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-45/681963/3 "2024-03-25T04:44:19Z")

</div>

Welcome to the forum @daniel.moreira

> [@daniel.moreira](#):
>
> ```auto
> const HTMLString = `
> 
> ```

Your code is almost perfect. After the first back tick, press the enter key.

Happy coding

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 23, 2024, 4:44pm UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-45/681963/4 "2024-09-23T16:44:32Z")

</div>

Closed on September 23, 2024, 4:44pm UTC

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