How to make pop-up for error bootstrap?

I am trying to make pop-up message for error. Currently the error message is displayed in the website content. How can I make it in pop-up?

Here is the current code:

  <div class="alert alert-danger display-none" id="add-item-error">

            </div>

Upvotes: 1

Views: 4444

Answers (1)

Shaminder Singh
Shaminder Singh

Reputation: 1293

just use the following code to view the popup. Use your css for the styling

<script type="text/javascript">
    $(document).ready(function(){
        $("#add-item-error").modal('show');
    });
</script>

Remember to put the code after adding the required jquery files.

Upvotes: 2

Related Questions