I have a problem with a single select element. I create a binding for the change event, and it works when I change the selected item manually, but if the select element is a binding to the specified value, the change function is not a call.
My html looks like this:
<select data-bind="value: myfield, event:{change:myfunction}"> <option value="">Select an element</option> <option value="1">Element 1</option> <option value="2">Element 2</option> </select>
I need this, so if the myfield property has a value other than ``, the change function will be executed.
If I select an element, then myfunction is a call, and everything is fine, but when the page loads and, for example, myfield has a value of "1", the function is not a call, and I need this function to be executed, I hope that you can solve my problem.
source share