I would like to have a dropdown list with options A, B, C and Custom. When custom is selected, the dropdown would be replaced by a text field so that the user can provide a custom name, if he wishes so.
So, first we have something like this
<select id="foo" name="foo">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
<option value="custom">Custom</option>
</select>
And after custom is selected, the whole dropdown list would transform to this:
<input name="foo" type="text" />