In this case, you open modal via data-attributes , and then close it with jQuery. Thus, in a sense, modal switching methods that contradict each other are used. So, remove the data attributes and show / hide modal with jQuery only.
Try the following:
$('#searchForm').modal('show');
To hide OnSuccess:
OnSuccess = "unloadModal"
The unloadModal function will be:
function unloadModal() { $('#searchForm').modal('hide'); };
source share