How to add jquery modal popup in PHP?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today now in this example is i will make modal by using jquery-ui.js library. Some times we may always need to jquery dialog box in our any project because modal is a very interesting and specially for GUI. Always i am like to use modal for creating data input or editing data and also for some conformation. So if we think also how to set the modal in my project then it is a very easy we have just need to copy the bellow example and run in your local you will find the result.

Now in this example i will provide the jquery modal example also with code so it pretty simple to use this.

Example:
<html lang="en">
<head>
    <title>JQuery Dialog Box Example</title>  
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <style type="text/css">
    #dialog{
        display: none;
    }
    </style>
</head>
<body>


<button>Click To Open Popup</button>


<div id="dialog" title="Itsolutionstuff.com">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>


<script type="text/javascript">
    $("button").click(function(){
        $( "#dialog" ).dialog();
    });
</script>


</body>
</html>

Read Also : How to use bootstrap colorpicker example code

Thanks for read. I hope it help you. For more you can follow us onĀ facebook.

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →