www.webdeveloper.com
Results 1 to 2 of 2

Thread: not show modal window

  1. #1
    Join Date
    Mar 2012
    Posts
    1

    not show modal window

    why does not open the dialog box "delete-dialog2" when running the line in bold

    Code:
    <script type="text/javascript">
        $(function () {
            var deleteLinkObj;
            // delete Link
            $('.delete-link').click(function () {
                deleteLinkObj = $(this);  //for future use
                $('#delete-dialog').dialog('open');
                return false; // prevents the default behaviour
            });
    
            //definition of the delete dialog.
            $('#delete-dialog').dialog({
                autoOpen: false, width: 350, resizable: false, modal: true, //Dialog options
                buttons: {
                    "Confirm": function () {
                        $.post(deleteLinkObj[0].href, function (data) {  //Post to action
                            if (data == '@Boolean.TrueString') {
                                deleteLinkObj.closest("tr").hide('slow'); //Hide Row
                                //(optional) Display Confirmation
                            }
                           else {
                                **$('#delete-dialog2').dialog('open');**
                            }
                        });
                        $(this).dialog("close");
                    },
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });
     $('#delete-dialog2').dialog({
                autoOpen: false, width: 350, resizable: false, modal: true, //Dialog options
                buttons: {
    
                    "Accept": function () {
                        $(this).dialog("close");
                    }
                }
            });
    
    
        });
    </script>
    It only shows the dialog with confirm and cancel buttons, but when to show cuandro dialog with the accept button is not shown blessings

  2. #2
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    eitehr your first condition is being met, #delete-dialog2 doesnt exist in the current document, or you are calling the function incorrectly. seeing as how .dialog() is probably from some kind of plugin, you should probably provide more information about it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles