JQuery - Custom Dialog


<html>
<head>
         <script language="javascript">
              $(document).ready(function () {
                       showDialogAlert('MyDialog', 'Hello', $('#myText'));
                       return false;
              }); 
              function showDialogAlert(title, message, objectOnFocus) {
                  $(document).ready(function () {
                        $("#dialog").dialog("destroy");//clear dialog cache
                        $("#dialog").dialog({
                            modal: true,
                            height: 500,
                            width: 420,
                            title: title,
                            buttons: { "OK": function () { $(this).dialog("close"); objectOnFocus.focus(); } },
                            close: function () { objectOnFocus.focus(); }
                       });

                       $("#dialog").html("<p>" + message + "</p>");
                 });

         }

     </script>
</head>
<body>

         <div id="dialog" title="Basic dialog" style="display:block">
         <input type="text" id="myText"/>
</body>
</html>

Popular posts from this blog

SAP CPI - Loop Process Call with SuccessFactor (oData V2)

Setting IntelliJ IDEA to run Groovy Script

C# - BASE64 to Image