I have a list of option inside select list, also I have textfield that contain the option value when selected.
i would like to make the textfield disable as default and when i’m selecting one of the options – the textfield will be enable.
Can someone direct me to a simiar example?
thanks
Here is an example using plain JavaScript jsfiddle:
HTML:
We started by disabled the input textfield.
Using the example on the previous post we basically add an onchange state to the select tag so when an option is selected we set the textfield’s value to what is currently selected, and then basically set the textfield’s disable to false. Thus, enable the textfield when an option is selected. Additionally, i added an option called ‘none’ so when user selects none it’ll diable the textfield.