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?
Corrected! Thank you!
one error left now!
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?
- 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 likeenjoyedMost='4'
or something). - 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 (likeradio='explore more'
).
Got a little verbose, but it can be a difficult thing to understand.
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!!!
thank you snowmonkey!