I’ve got a select with two ‘special’ options, a bit like this:
<select> <option value='????'>Choose one:</option> <option value='1'>option1</option> <option value='2'>option2</option> .... <option value='????'>Free input</option> </select>
When the user selects nothing, I should ignore the input. When the user selects ‘free input’, the value from a corresponding textbox is used.
I was wondering, which values would you give those options? I figured I should be able to use no value for the first, because that’s what it is: no value. But the last option, should I use -1, 0, or something different?
I would use something that will be understandable to the next developer who will be reading the code. Therefore something like ‘freeInput’ or ‘textFieldLookupValue’ could be appropriate