Skip to content
  • Github
  • Facebook
  • twitter
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
  • Site Map

XpertPhp

Expertphp Is The Best Tutorial For Beginners

  • Home
  • Javascript
    • Jquery
    • React JS
    • Angularjs
    • Angular
    • Nodejs
  • Codeigniter
  • Laravel
  • Contact Us
  • About Us
  • Live Demos

Home » Css » How To Make Dialog Box/Popup Using Bootstrap

bootstrap popup

How To Make Dialog Box/Popup Using Bootstrap

Posted on June 27, 2019December 17, 2022 By XpertPhp No Comments on How To Make Dialog Box/Popup Using Bootstrap

We will discuss how to make dialog box/popup using bootstrap. so we will give you a simple example of a bootstrap popup, bootstrap dialog box and bootstrap modal.

normally many learners cannot make the dialog box and face the problem regarding the dialog box. many plugins are available for the make the dialog box. but here simply we will use the bootstrap model dialog box.

Now, we will load the bootstrap.min.css, jquery.min.js and bootstrap.min.js. so you can follow the below example.

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container">
  <!-- When you click on button then open the modal -->
  <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#largeModel">Open Large Modal</button>
  <div class="modal fade" id="largeModel" role="dialog">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Large Modal</h4>
        </div>
        <div class="modal-body">
          <p>Hello XpertPhp.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>      
    </div>
  </div>
  
  <br/><br/>
  <!-- When you click on button then open the modal -->
  <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#smallModel">Open Small Modal</button>
  <div class="modal fade" id="smallModel" role="dialog">
    <div class="modal-dialog modal-sm">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Small Modal</h4>
        </div>
        <div class="modal-body">
          <p>Hello XpertPhp.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>      
    </div>
  </div>
</div>
 
</body>
</html>
See also  Bootstrap Datepicker Disable future Dates Example

Here above example we have used data-toggle and data-target. The data-toggle is one type of modal window and the data-target is when you click on the button then target attribute wise it will open a particular target model. you can make sizes wise models such as modal-sm and modal-lg.

If you like this article then You can see, comment and share this article demo.

Show Demo

Bootstrap, Css Tags:Bootstrap Example, bootstrap modal, dialog box

Post navigation

Previous Post: Login with Facebook using PHP
Next Post: Jquery countdown timer with setInterval

Latest Posts

  • Laravel 12 Ajax CRUD Example
  • Laravel 12 CRUD Example Tutorial
  • How to Create Dummy Data in Laravel 11
  • Laravel 11 Yajra Datatables Example
  • Laravel 11 Ajax CRUD Example
  • Laravel 11 CRUD Example Tutorial
  • Laravel 10 Ajax CRUD Example Tutorial
  • Laravel 10 CRUD Example Tutorial
  • How to disable button in React js
  • JavaScript Interview Questions and Answers

Tools

  • Compound Interest Calculator
  • Hex to RGB Color Converter
  • Pinterest Video Downloader
  • Birthday Calculator
  • Convert JSON to PHP Array Online
  • JavaScript Minifier
  • CSS Beautifier
  • CSS Minifier
  • JSON Beautifier
  • JSON Minifier

Categories

  • Ajax
  • Angular
  • Angularjs
  • Bootstrap
  • Codeigniter
  • Css
  • Htaccess
  • Interview
  • Javascript
  • Jquery
  • Laravel
  • MongoDB
  • MySql
  • Nodejs
  • Php
  • React JS
  • Shopify Api
  • Ubuntu

Tags

angular 10 tutorial angular 11 ci tutorial codeigniter 4 image upload Codeigniter 4 Tutorial codeigniter tutorial CodeIgniter tutorial for beginners codeigniter with mysql crud operation eloquent relationships file upload File Validation form validation Image Upload jQuery Ajax Form Handling jquery tutorial laravel 6 Laravel 6 Eloquent Laravel 6 Model laravel 6 relationship laravel 6 relationship eloquent Laravel 6 Routing laravel 7 Laravel 7 Eloquent laravel 7 routing laravel 7 tutorial Laravel 8 laravel 8 example laravel 8 tutorial laravel 9 example laravel 9 tutorial Laravel Framework laravel from scratch laravel social login learn jquery nodejs pagination payment gateway php with mysql react js example react js tutorial send mail validation wysiwyg editor wysiwyg html editor

Copyright © 2018 - 2025,

All Rights Reserved Powered by XpertPhp.com