I’m trying to open bootstrap modal after login failed, I used the following code:
JavaScript
x
if (mysqli_num_rows($query) != 0)
{
// Login successfully
}
else
{
//Login failed
echo '<script type="text/javascript"> $("#LoginFailed").modal("show")</script>';
}
And I incloud jQuery 1.12.4 in HTML head
JavaScript
<script src="js/jquery-1.12.4.js"></script>
Nothing happen, The LoginFailed
modal not showing up !!
I also trying the solution HERE but no luck.
Any help?
Advertisement
Answer
I tried to tailor the exemple to yours. NOTE: In JSFiddle it will not be accurate since it only runs js css and HTML
You need to use
JavaScript
jQuery(document).ready(function (e) {
// Your Modal
}