What does value = " " do?

I am currently on the section learn html by building a registration form-step 35.

here is the link for context:

The goal of this step seems to be giving the redundant option in a drop down list no value, by making their value = " " . And will give every option that is useful an actual value, value = " 1 " for example.

However I don’t see how this helps. If something doesn’t have a value can’t it still be submitted? Are they just trying to make it so if someone does submit the option that is redundant, that option won’t go to their servers?

sorry if this doesn’t make too much sense. If context is needed I will provide more.

But my original question still stands, what exactly does giving something no value do? ( value = " ")

What you may not be imagining is that these values get passed to a backend program. This backend program must use these values to do something interesting (maybe it triggers different followup questions for eg based on the value)

Setting value to an empty string of characters “” will tell it that the user did not make an interesting choice so it will reserve its subsequent reaction (that is just one possible scenario).
The programmer gets to decide what constitutes an interesting value or not. In many cases an empty “” sting like this constitutes nothing of importance and is worth communicating as such. (User didn’t make an interesting selection…)

1 Like

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