Click here to Skip to main content
15,918,404 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a strange error occurring with the dialog box, I'm loading the dialog box fine, but whenever I assign a button to it, my dialog box is not displaying
This is my code Before include Button:
JavaScript
$(document).ready(function () {

       $("#dialog").dialog({
           autoOpen: true,
           modal: true,
           title: "Information",
           width: 200,
           height: 150,
           open: function () {
           }});

This Code After include button Statement
JavaScript
$(document).ready(function () {

      $("#dialog").dialog({
          autoOpen: true,
          modal: true,
          title: "Information",
          width: 200,
          height: 150,
          open: function () {
          },
          buttons:{
              text:"Ok",
              click   : function() { $(this).dialog('close'); }
          }
      });

can any one help me to solve this problem
Posted

$(document).ready(function () {
 
        $("#dialog").dialog({
            autoOpen: true,
            modal: true,
            title: "Information",
            width: 200,
            height: 150,
            open: function () {
            },
            buttons:[{
                text:"Ok",
                click   : function() { $(this).dialog('close'); }
            }]
        });
});
 
Share this answer
 
Comments
Sravanthid28 17-May-13 7:42am    
this is also not working
you can try this...

JavaScript
<script type="text/javascript">
    $(document).ready(function () {
        $("#dialog").dialog({
            autoOpen: true,
            modal: true,
            title: "Information",
            width: 200,
            height: 150,
            buttons: {
                Ok: function () {
                    //Do u r stuff here
                },
                Cancel: function () {
                    $(this).dialog("close");
                }
            }
        });
    });
</script>
 
Share this answer
 
v2
Comments
Sravanthid28 20-May-13 2:05am    
how to show error icon for message box
SPASWIN 20-May-13 2:27am    
hi..
You can add the Error Icon in Your dialog holder

For Example:
<div class="dialog">
//Here You can Add/show Error icon
or
//add error icon in your dialog.css(style)
</div>

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



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