Is this a bug? - Responsive Web Design Projects - Build a Survey Form

Hello.

In the second of “Responsive Web Design Projects” that is " Build a Survey Form" one of the users stories is:

User Story #14: Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

But if you create additional checkboxes in other place of the html code, the test fails.

I had one “I agree with terms” at the end of my survey and that makes it fails.

Is that a bug or is that we can’t add components to the projects if there are not required by tests?

This is my Codepen:

https://codepen.io/rigo-villalta/pen/jpOpxm

And if there is some feedback about it I would really appreciate it.

Can you post a pen where you add extra components and the tests fail? The tests just confirm you meet the minimum requirements of the User Stories. Anything you add extra should not be a problem, but I would need to see the problem solution first.

Thanks for the answer randelldawson.

I forked the Codepen and I put again the checkbox, and again one test fails.

https://codepen.io/rigo-villalta/pen/ejYXGe

The extra one you added (below) is missing something the test is looking for. Read the test result carefully and see what is missing from yours.

<input type="checkbox" name="agree" required>

That is my point randelldawson.

Of course I understand that the test is looking for a set of checkboxes that share the name attribute, but it is not clear if I will have to use that standard in all projects from here.

If some users story ask for some requirement, will we have to use this requirement in all the same type of marks, styles, etc.?

The issue is not the name attribute. The issue is that your input with type=“checkbox” does not have a value attribute, such as value=“agreed”.

I have bolded the part of the test result you were failing:

  1. Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

Whatever the User Stories request, you must do. You were fine in adding the extra checkbox, but you needed to make sure it had a value attribute as checkboxes need the value attribute to pass the value to a script to process.

You are completely right.

Thanks for the help randelldawson.

Hello Rigo,Villalta i can’t understand that User Story # 14 (html-css ) in survey project. Can you tell me
how to use and where value attrubute is used in checkbox and how it works…

Hello @kusumanadh, welcome to the forum

First you have to check if you have the User Story #3

User Story #3: I can see a form with id="survey-form" .

After that you code all User Stories from 4 to 13.

The User Story #14 is:

User Story #14: Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

First, the form element is that made in User Story #3, inside this element you will code several checkboxes, every of that checkboxes must have a atribute that is a value, if you are not sure about it, you can’t see this link:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox

You can see my codepen as example, I made a copy and paste of countries, I didn’t think a reason to code all countries by myself.

Go to the line 268 in order to see exactly the User Story #14.

I hope it helps.

Thank you @Rigo-Villalta …i completed it and also it was submitted…