You must Sign In to post a response.
  • Category: HTML

    How to create modal dialog box in php?

    Friends,

    how to create modal dialog box in php?
  • #748766
    With the help of ShowModalDialog method in javascript you can show modal popup
    see below snippet to check how to show it
    showModalDialog method, Creates a modal dialog box that displays the specified HTML document.

    window.showModalDialog("test.htm", "_blank")

    There are many parameters we can pass to modal dialog, refer below link for more detail
    http://msdn.microsoft.com/en-in/library/ie/ms536759(v=vs.85).aspx

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #748767
    You should go with jQuery or Javascript popup dialogue.

    Try to explore more about jQuery popup dialogue in google.
    I am giving you some reference links take a look.

    http://jqueryui.com/dialog/

    http://aspsnippets.com/Articles/Simple-jQuery-Modal-Popup-Window-Example-in-ASPNet.aspx

    http://www.aspdotnet-suresh.com/2013/03/simple-jquery-modal-popup-window-example.html

    http://simplemodal.plasm.it/

    http://www.ericmmartin.com/projects/simplemodal-demos/

    http://www.jquerybyexample.net/2012/12/10-jquery-modal-dialog-boxes-plugins.html

    http://www.sitepoint.com/14-jquery-modal-dialog-boxes/

    http://www.jqueryrain.com/example/jquery-popup-window/page/10/

    Regards,
    Nirav Prabtani (Senior Web Developer)
    Email : niravjprabtani@gmail.com
    blog : niravprabtani.blogspot.in

  • #748788
    Hi,

    As you are aware we are mostly on .NET and Microsoft technologies. For quick answer you may post this in any of the PHP forums.
    Here you go for the sample code and detailed explanation: examples.qcu.be/assets/_core/php/examples/advanced_ajax/dialog_box.php


    Regards,
    Asheej T K

  • #748831
    Hello,

    You can try the following code:-
    ---------------------------------
    <?php

    If ($phpcondition) {
    ?>
    <script language='Javascript'>
    blah = window.open('openthepopup.php');
    </script>
    <?
    }


    ?>
    ------------------------------------

    Or can also try the following code:-
    -----------------------
    <?php


    If ($phpcondition)
    {
    echo "<script>blah = window.open('openthepopup.php')</script>";
    }



    ?>

    -----------------------

    With the above code: "openthepopup.php" is the page which will be opened within the popup window.

    And if you want to decorate the popup window somehow a bit smart, then you can try the following free online tool for the same purpose:-
    ------------------------------------------
    http://www.textfixer.com/html/javascript-pop-up-window.php
    ------------------------------------------

    Whenever using the above mentioned online tool for decorating the popup window, keep in mind that this tool will produce a code within a hyperlink, so there will a bit more code which you will no need to use. So, you just copy the portion of the code which is like: "window.open(any-value,any-value,any-value)"

    --------------------------------
    Thanks,
    ARIJIT DAS.

  • #748848
    Hi,

    Create a hyperlink on which you need to show the modal pop up box-

    <a href="#" class="paulund_modal">Click Here</a>

    Create The JQuery Modal Box Plugin:
    Create a new javascript file and call it jquery.paulund_modal_box.js and save in the same folder as your webpage.
    (function($){

    // Defining our jQuery plugin

    $.fn.paulund_modal_box = function(prop){

    // Default parameters

    var options = $.extend({
    height : "250",
    width : "500",
    title:"JQuery Modal Box Demo",
    description: "Example of how to create a modal box.",
    top: "20%",
    left: "30%",
    },prop);

    return this.click(function(e){
    //Do stuff here
    });

    return this;
    };

    })(jQuery);

    For the design and other details, please see the below link-

    http://www.paulund.co.uk/how-to-create-a-simple-modal-box-with-jquery

    Hope this will help you !!

    Thanks,
    Ashutosh Jha
    http://tricksroad.com


  • Sign In to post your comments