"Inside the form element" HELP

12 tests out of 17 passed. Most of my errors are about the “inside the form” issue
Need guidance please help! I might start over…
Thank you!
survey form

Why do you have 3 separate form elements?

1 Like

Corrected! Thank you!
one error left now!

1 Like

two things jump out at me, though only one seems to be a fail. Your checkboxes have no name, and your radios no values.

Went back this morning, tested your codepen to include values for the checkbox, that’s what’s going wrong. An example of what it’s looking for:

<input type='radio' name='radio' checked value='explore more'>

When a form is submitted, the form serialization mechanism (the way the form gets sent to the backend) happens in a certain way. It is taken from form data, and turned into a submit body OR into a serialized string, consisting of name/value pairs.

Why am I taking the time to spell that out? What do you think is going to happen when someone submits your form?

  1. the checkboxes likely aren’t going to be included. They have no name, so there is no indication to the DOM processor that they are to be included in a sumission. What that would do in the form serialization is more a thought experiment than an actual, as it likely would silently be ignored, but what you’d send would be something like ''=4 (rather than something like enjoyedMost='4' or something).
  2. the radio buttons are going to do something unexpected. When one is selected, the form serialization will take the “checked” radio button, and use THAT input’s value as the value of the radio set. By leaving off a value for it, you’re saying to send something like radio='', rather than a meaningful value (like radio='explore more').

Got a little verbose, but it can be a difficult thing to understand.

1 Like

Oh my god yes, it is well explained!
Makes sense and the meanings of “values” and “names” are a lot clearer now.
I have corrected both and now i’am at 17/17.
Just need to re/style a few things now and will be ready to submit.
Thanks a million!!!

1 Like

Sweet! Glad it made sense. Doing great, @astra11, keep it up! :slight_smile:

1 Like

:grin: thank you snowmonkey!

1 Like