title: Data-Dismiss: How to dismiss bootstrap modal inside function
body: <p>I have a modal in which I need to validate some input using knockout validation.
  When I click the submit button, a function is called that validates the data. The following functionality is expected:</p>
  
  <ul>
  <li>If the validation fails, the modal stays open and the validation reason is displayed.</li>
  <li>If the validation succeeds, I want to close the modal.</li>
  </ul>
  
  <p>How can I go about closing the modal inside my function?</p>