Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data-Dismiss: How to dismiss bootstrap modal inside function

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:

  • If the validation fails, the modal stays open and the validation reason is displayed.
  • If the validation succeeds, I want to close the modal.

How can I go about closing the modal inside my function?

like image 320
Daryl Avatar asked Nov 27 '22 23:11

Daryl


1 Answers

What have you tried so far?

Per the Bootstrap documentation

$('#myModal').modal('hide')

Please read through the documentation!
http://getbootstrap.com/javascript/#modals

like image 186
Cheruvian Avatar answered Dec 10 '22 03:12

Cheruvian