Link to home
Avatar of lulu50
lulu50Flag for United States of America

asked on

Remove "close" word from my dialog box

Hi,

my dialog box has the word "close" on top right
 
how can I remove it?

Thanks,


  $(function () {
            $('#dialog').dialog({
                autoOpen: false,
                width: 800,
                height:600,
                resizable: true,
                title: 'Product',
                modal: true,
                open: function(event, ui) {
                    $(this).load("@Url.Action("RulePartialView", "CareAdvanceBusinessRules")");
                },
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                }

            });
            $("#opener").click(function (event) {
                event.preventDefault(); 
                $("#dialog").dialog("open");
            });
        });

  <div id="dialog" title="Basic dialog"> </div>

    <a id="opener" href="@Url.Action("RulePartialView", "CareAdvanceBusinessRules")">Click to open popup window </a>

Open in new window

Avatar of lulu50
lulu50
Flag of United States of America image

ASKER

Maybe I should have an "x" instead of the word "close"
Avatar of Paul MacDonald
Remove it by eliminating lines 12-16.

Change it by editing the word "Close" on line 13.
Avatar of lulu50

ASKER

the button close code is for my button
I want to keep it

 buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                }

Open in new window


but I see the word "close" on the top right side of my dialog box that i need to remove it or change it from "close" to "x"
I'm no jQuery programmer, but I'm suggesting this:

 buttons: {
                    "X": function () {
                        $(this).dialog("close");
                    }
                }
Avatar of lulu50

ASKER

Paul

that made my button "X" but what I want to  change is the top right "close" not my button

I attach a picture of my dialog box

look at the top right side where you'll see the word "close" that's what I want to change.
popup-window.png
Avatar of lulu50

ASKER

I found a solution to it

I added this code and my "close" top right disappeared

       closeOnEscape: false,
            open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of lulu50
lulu50
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
I'm glad you were able to solve your problem.  Sorry I couldn't be of more assistance.
Avatar of lulu50

ASKER

Paul

Thank you for all your help:

this is what I have for the final result:

 $(function () {
            $('#dialog').dialog({
                autoOpen: false,
                width: 800,
                height:600,
                resizable: true,
                title: 'Product',
                modal: true,
                open: function(event, ui) {
                    $(this).load("@Url.Action("RulePartialView", "CareAdvanceBusinessRules")")
                    $(".ui-dialog-titlebar-close").hide();
                },
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                },
               closeOnEscape: false,
            });
            $("#opener").click(function (event) {
                event.preventDefault();
                $("#dialog").dialog("open");
            });
        });