Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Hi,

Today i was working on JQUERY Modal Dialog Box

My Code:

<div id="dialog">
this is from my dailog!
</div>
    <button id="Button1" >Message</button>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $(function () {
            $("#dialog").dialog({

                autoOpen: false,
                modal: true,
                show: {
                    effect: "shake",
                    duration: 1000
                },
                hide: {
                    effect: "slide",
                    duration: 1000
                }
            });
        });
       
    });
   
    
</script>
<script>
    $(document).ready(function () {
        $("#Button1").click(function () {
            $("#dialog").dialog("open");
        });
    });
</script>

But its working on only for the first time I click the button, after closing the dialog, and again was clicking the button to popup but its not getting..doing..anything
Please suggest me..what to do..




Thanks
ABDUL SUBHAN
Posted
Updated 1-Jan-14 19:43pm
v3

1 solution

Try is as below.

C#
$("#Button1").off('click').on('click',function () {

    $("#dialog").dialog("open");
    return false; //to prevent the browser actually following the links

});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900