Avatar of lulu50
lulu50
Flag 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

.NET MVCC#jQuery

Avatar of undefined
Last Comment
lulu50

8/22/2022 - Mon
lulu50

ASKER
Maybe I should have an "x" instead of the word "close"
Paul MacDonald

Remove it by eliminating lines 12-16.

Change it by editing the word "Close" on line 13.
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"
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Paul MacDonald

I'm no jQuery programmer, but I'm suggesting this:

 buttons: {
                    "X": function () {
                        $(this).dialog("close");
                    }
                }
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
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

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
lulu50

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Paul MacDonald

I'm glad you were able to solve your problem.  Sorry I couldn't be of more assistance.
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");
            });
        });