Validation errors...grouped radio button

i still have three error showing up…HTML5 validations for name and email input fields…and grouping at least 2 radio buttons together…i don’t understand how to fix the validation issue…and, i thought i already had grouped the radio buttons together

also, how do i connect the test window to my Cope Pen project?..i’ve just been following the link, and copying/pasting my code into the editor provided

Hi @halfmeasuresroom, read the message for each of the failing tests. Click on the red button for the failing tests and it will tell you what it’s looking for and then compare with what you have. For instance, the failing test for the field with id=“name” says,
Inside the form element, I am required to enter my name in a field with id="name". If I do not enter a name I will see an HTML5 validation error. Name input field should be required : expected false to be truthy
Is yours required?
The field with id=“email” gives a similar message.
For the last failure I’d say to review this lesson regarding name / value attributes

Keep the test script when forking the pen (<script src=""></script>). You can copy/paste it into the HTML section of codepen

thanks for your help with this…i still don’t understand how to make input fields “required”…not sure where that is found in our curriculum

1 Like

thank you…that was very helpful…i only have one error left to fix now…it is with the grouping of radio buttons…i already have the two radio buttons grouped together…they are labelled as #question1, #question2 etc…not sure what else needs to be done there?

look at the message below the failing user story

Every radio-button group should have at least 2 radio buttons : expected 1 to be at least 2

I will let you try to find wich one have issues

1 Like

I still don’t see it…every group of radio buttons I have made contain two…unless they aren’t to be grouped by the div element?..can they only be grouped together with the label element?..if so, that is may cause a problem and change how my sheet looks?

you group radio buttons together making them have the same name attribute

ok…i still don’t see where I’ve gone wrong with that…all the radio buttons I have grouped together have the same name attribute

do i put the name attribute in the div element? that where I’ve gone wrong with this?

i moved the name attribute to the div element…still getting the same error…and now it’s talking about having values for each radio button, which i have…i’m really confused as to what needs to be done here

I only see one radio button with a name attribute on it in your Codepen. You can review this challenge.

Edit: and here is the MDN docs

Defining a radio group

A radio group is defined by giving each of radio buttons in the group the same name. Once a radio group is established, selecting any radio button in that group automatically deselects any currently-selected radio button in the same group.

You can have as many radio groups on a page as you like, as long as each has its own unique name.

1 Like

I see what it was now…there was one input element that had a name in there that wasn’t fitting the group…i didn’t see it before because it was in a different place than all the others…thanks for having me look into this on my own…i really appreciate the guidance from everyone on this thread

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