title: Set on change event with Knockout into select dropdown
body: <p>I have a dropdown working nice:</p>
  
  <pre><code>&lt;select class="picker-select" data-bind="options: searchOptions, select:{}, optionsText: 'name', optionsValue: 'id', value: selectedSearchOption" &gt;&lt;/select&gt;
  </code></pre>
  
  <p>Now I want to execute a function when selection changes but it does not seem to work. </p>
  
  <hr>
  
  <p>What I've tried:</p>
  
  <p><a href="https://www.w3schools.com/jsref/event_onchange.asp" rel="nofollow noreferrer"><strong><code>onchange</code> event</strong></a>:</p>
  
  <pre><code>onchange="actionWhenChange()"   // also tried without parenthesys
  </code></pre>
  
  <p><strong>MODEL:</strong></p>
  
  <pre><code>function actionWhenChange(event) {
    console.log("doing stuff");
  };
  </code></pre>
  
  <p><strong>ERROR:</strong></p>
  
  <blockquote>
    <p>Uncaught (in promise) ReferenceError: actionWhenChange is not defined</p>
  </blockquote>
  
  <hr>
  
  <p>And with <a href="http://knockoutjs.com/documentation/event-binding.html" rel="nofollow noreferrer">knockout <code>event</code> binding</a> (also tried without parenthesys)</p>
  
  <pre><code>data-bind="event: { onchange: actionWhenChange() }, ... more bindings
  </code></pre>
  
  <p><strong>MODEL:</strong></p>
  
  <pre><code>self.actionWhenChange = function (event) {
    console.log("doing stuff");
  }
  </code></pre>
  
  <p>But I get no error.</p>
  
  <p>Any ideas?</p>