Knockout subscribe multi-select dropdown
<p>In a purchase order, I want to calculate total amount of all line items based on prices and taxes. For each item, there are multiple taxes. I am using knockout bindings for this. Everything works except the taxes section. When I add a new tax or remove, its not updating the total. I tried with custom bindings (update), that seems not working for me.</p>

<p><a href="https://jsfiddle.net/krishnasarma/r0doakyk/" rel="nofollow">https://jsfiddle.net/krishnasarma/r0doakyk/</a></p>

<p>HTML:</p>

<pre><code>&lt;table&gt;
&lt;tbody data-bind='foreach: Entries'&gt;
&lt;tr&gt;
  &lt;td&gt;
  &lt;input type="text" data-bind="value:Amount" /&gt;
  &lt;/td&gt;
  &lt;td&gt;
    &lt;select multiple data-bind="ddl1: null, SelectedOptions:Taxes"/&gt;
  &lt;/td&gt;
&lt;/tr&gt;                          
&lt;/tbody&gt;
&lt;/table&gt;
&lt;input type="text" data-bind="value:$root.Total()" /&gt;
</code></pre>

<p>JS:</p>

<pre><code>ko.bindingHandlers.ddl1 = {
    init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
        $(element).append('&lt;option value=1&gt;My tax 1&lt;/option&gt;');
    $(element).append('&lt;option value=2&gt;My tax 2&lt;/option&gt;');
    },
   update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
   alert(valueAccessor());
     }
}


function Entry(child) {
    var self = this;
    self.Amount = ko.observableArray(child.Amount);
    self.Taxes = ko.observableArray(child.Taxes);
}
var VM = {
    Entries: ko.observableArray([]),
    Total: function(){
        var tot = 0;
        for (var i = 0; i &lt; VM.Entries().length; i++) {
                var amt =  parseFloat(VM.Entries()[i].Amount());
            var taxtot = 0;
            for(var j=0;j&lt;VM.Entries()[i].Taxes.length;j++){
                    taxtot += amt*parseFloat(VM.Entries()[i].Taxes[j]);
            }
            tot +=taxtot;
        }
        return tot.toFixed(2);

    }
}
$(function () {
        VM.Entries().push(new Entry({}));
    VM.Entries().push(new Entry({}));
        ko.applyBindings(VM);
});
</code></pre>