# Help with survey form - arkieflier

**URL:** <https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [April 15, 2022, 6:38pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889 "2022-04-15T18:38:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![arkieflier](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@arkieflier](https://forum.freecodecamp.org/u/arkieflier)\
**Post date:** [April 15, 2022, 6:38pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/1 "2022-04-15T18:38:32Z")

</div>

I seem to have a conflict between User Story #4 and #10. If the test suite passes #4, it fails at #10.

#4 plainly says to use _id=“ **name** ”_. #10 talks about using _id=“ **name-label** ”_

If I use id=“name-label” in \<label… **and** \<input… #10 passes but #4 fails.  
If I use id=“name” in \<label… **and** \<input… both #4 and #10 fail, even though #4 specifically asks for id=“ **name** ”.

Regardless of the term I use, I get a warning (_Fill out this field_) that the field needs an entry. I think that comes from the ‘required’ (HTML5?) attribute.

BTW, I can’t seem to find the way to start a new thread/question/post. :headbash:

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [April 15, 2022, 6:42pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/2 "2022-04-15T18:42:02Z")

</div>

This user story

> **User Story #4:** Inside the form element, I am required to enter my name in a field with `id="name"` .

is talking about a field inside of the form element.

This user story

> **User Story #10:** For the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids: `id="name-label"` , `id="email-label"` , and `id="number-label"` .

is talking about the label element for the above mentioned field. The field and its label are separate (but related) things.

---

<div class="post-metadata">

**Author:** ![arkieflier](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@arkieflier](https://forum.freecodecamp.org/u/arkieflier)\
**Post date:** [April 15, 2022, 6:45pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/3 "2022-04-15T18:45:03Z")

</div>

Never mind. I finally figured out how to pass both #4 and #10.

But I don’t understand the difference between “id=” in a `<label>` and the same attribute in the `<input>`. Are these differently named id’s mainly for javascript? 🤔

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [April 15, 2022, 6:46pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/4 "2022-04-15T18:46:17Z")

</div>

It has nothing to do with Javascript. They are different elements. Giving the exact same id to two different elements would be confusing.

---

<div class="post-metadata">

**Author:** ![arkieflier](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@arkieflier](https://forum.freecodecamp.org/u/arkieflier)\
**Post date:** [April 15, 2022, 6:49pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/5 "2022-04-15T18:49:05Z")

</div>

I just noticed that the post I replied to was “split”. I entered the following, since I could not delete my original post.

> Never mind. I finally figured out how to pass both #4 and #10.
> 
> But I don’t understand the difference between “id=” in a `<label>` and the same attribute in the `<input>` . Are these differently named id’s mainly for javascript? 🤔

---

<div class="post-metadata">

**Author:** ![arkieflier](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@arkieflier](https://forum.freecodecamp.org/u/arkieflier)\
**Post date:** [April 15, 2022, 6:58pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/6 "2022-04-15T18:58:09Z")

</div>

Thanks! If I am listed as an ‘author’ of a post, I can then edit any posts I make in that thread.

I understand that (I thought! 😊 ) about “one id [label] per page”. It’s a basic CSS/HTML idea! Somehow, I was getting confused\<- by ‘id’ and ‘for’ in a label and an ‘id’ and ‘name’ in the input.

My ‘state of residence’ is “confused”! 🤣

---

<div class="post-metadata">

**Author:** ![arkieflier](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@arkieflier](https://forum.freecodecamp.org/u/arkieflier)\
**Post date:** [April 15, 2022, 7:10pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/7 "2022-04-15T19:10:23Z")

</div>

Use “min” and “max” in the Input.

In my form, I have _ **two** _ fields that accept numbers.  
One includes both the “min” and the “max” attributes.

However, the other number field can have practically any number. I set the “min” to 0 (zero), but I see no real need to set a “max”. Of course, to get the test suite to pass, I may have to insert an irrelevant number? 🤔

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [April 15, 2022, 7:14pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/8 "2022-04-15T19:14:13Z")

</div>

As I read it, only the number field that is being checked by the test suite (the one from User Story #7) needs the validation with both a min and a max. There should only be one field with the id of “number”.

> **User Story #7:** Inside the form, I can enter a number in a field with `id="number"` .

> **User Story #9:** If I enter numbers outside the range of the number input, which are defined by the `min` and `max` attributes, I will see an HTML5 validation error.

---

<div class="post-metadata">

**Author:** ![arkieflier](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@arkieflier](https://forum.freecodecamp.org/u/arkieflier)\
**Post date:** [April 15, 2022, 7:25pm UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/9 "2022-04-15T19:25:23Z")

</div>

I had only one field with the “id=number”. I added a ‘max=“50000”’ to the other place I needed a number and that allowed the test suite to pass. The number refers to the number of flight hours a pilot has, “50,000” should cover the majority of pilots!

BTW, I have passed (17/17) the test suite now. The last edit required I put the “dropdown” id in the input(select) rather than in the Label where I had it. Perhaps I’ll try to always add “XYZ-label” to all id’s in a Label and put an id of “XYZ” in the input. Oh well…

Thanks again!! 👍

---

<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:** [October 15, 2022, 7:26am UTC](https://forum.freecodecamp.org/t/help-with-survey-form-arkieflier/504889/10 "2022-10-15T07:26:12Z")

</div>

Closed on October 15, 2022, 7:26am UTC

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