.hidden class to the error modal in the HTML so it does not appear when the page first loads code example
Example: $('#mymodal').modal('show') not working
<script type="text/javascript">
$(document).ready(function(){
$("#login-modal").modal("show");
});
</script>