title: Using bootstrap modals in KnockoutJS
body: <p>I'm having a difficult time figuring out how to do this.  I have a KnockoutJS viewmodel attached to a table of inputs.  When the first input in each row blurs, I pop up a modal asking the user a question.  If they answer 'no', the focus needs to go back to the original input.  If 'yes', the focus should jump to the next input in the row.  I'm not sure how to pass along the input ID from knockoutJS into the modal and back out again.  Or if there is a better way to do it.</p>
  
  <p>HTML for the input with blur function:</p>
  
  <pre><code>&lt;td data-bind="css: { highlighted: $root.highlightedRowIndex() == $index() }"&gt;
    &lt;input type="text" data-bind="value: itemNo, insertPress: $index, deletePress: $index, hasFocus: invalidItemNum, selected: invalidItemNum, event: { blur: function(){ $parent.checkItemNo($data, $index); } }, attr: { name: 'sellerItems[' + $index() + '].itemNo', id: 'sellerItems_' + $index() + '__itemNo', tabindex: 5 + $index() }" class="form-control" /&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>And the associated KO:</p>
  
  <pre><code>self.checkItemNo = function(data, index) {
                  console.log(data);
                  var itemNo = $.trim(data.itemNo());
                  if(verify == "False") {                    
                      ......
                  } else {
                      if(!foundItem &amp;&amp; itemNo != "") {
                          $('#invalidItemMsg').html("Item number &lt;strong&gt;" + itemNo + "&lt;/strong&gt; is not a valid item number.  Would you like to report it?")
                          $('#invalidItemNum').val(itemNo);
                          $('#invalidItemModal').modal('show');
                      }
                  }
              };
  </code></pre>
  
  <p>And then my JS modal button click event(the 'yes' button in the modal):</p>
  
  <pre><code>$('#reportItem').click(function() {
              $('#invalidItemModal').modal('hide');
              // ??? - go to next knockout input from previous input that was blurred
          });
  </code></pre>