I have an input field that should be populated dynamically when a selectbox changes it’s value. So, I binded the variable to the input and another value to the selectbox’s selected value. Now I want to be able to change the input value programmatically: for certains values of the selectbox the value should be an empty string and for others I should set it with some javascript code when the user does some actions. I though to use a computed function, so I can return the empty string but this lead me to a problem: how can I then set the value programmatically when the other selectbox options are selected?
I have an input field that should be populated dynamically when a selectbox changes
Share
If your goal is to default in a value into the
inputwhenever theselectchanges and allow a user to update it freely, then a good choice is to use a manual subscription.