For some reasons the bootstrap model box was not loading ajax content. I was trying this is wordpress and having a hard time fixing the issue. With some research i found the solution.
The code was working perfectly fine but the data didn’t refresh for some reasons. So added a bootstrap jquery snippet.