Survey Project - radio buttons/check box value issue

Survey Project - radio buttons/check box value issue
0

#1

Hi, I’m having a problem passing the test for the survey project. link to which is here:

The two failing tests are as follows:

  1. Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute.
  2. Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

Clearly it’s the same issue on both but I cannot figure out how to fix it, any advice would be much appreciated.

As an aside, I’m struggling getting to grips with the best way to arrange and set the layout, any recommendations for a way to make it look better generally would be much appreciated.


#2

Hi @pete0308

  1. You forget to add a label for the first radio button,
    Note: The for="" attribute in the label should match the id="" of the input element
  2. You should create value="" attribute for all the input type radio elements
  3. Do the step two of creating the value="" attribute to all the input type checkbox elements

#3

Add the value attribute


#4

That’s what i said, add it to your <input type="" value=""> like this, the value attri mentions the text
Ex: radio1, radio2 etc… ( Based on your code )


#5

To add to this, the for="" in the label is not necessary but makes it so you can click the label to check the radio-button/checkbox

You also need to close your <form> tag


#6

Thank you so much for your help, I still can’t get it to pass rule 13 though. I’ve now got an id, a value and a name attribute set. It is working for the check boxes now but not the radio buttons… could you let me know where I’m going wrong here?


#7

The name="" attribute of the radio buttons should be same, currently your are able to select all the options of the radio button, which is not correct for radio types, it happens because you have different values for the name="" attribute, change it to same name Ex: radio1


#8

Thank you for your help, much appreciated! All working now!