Take the 2-minute tour ×

I am using this jquery-ui to display a dialog box but it comes with a freebee named as "close" which I don't want,

you can find rest of code here, Why my Dialog box isn't working

In html its coming up as

<a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button">
share|improve this question
I can't find any function here to hide it, jqueryui.com/dialog –  Customized Name Mar 4 '13 at 13:11
Why negative vote without explanation ? –  Customized Name Mar 4 '13 at 13:14
See the API documentation under Hiding the close button. –  Boaz Mar 4 '13 at 13:14
Because you didn't make much effort in solving problem by yourself, instead you are aksing a question that has been answered many times! –  Simon Mar 4 '13 at 13:15
In your defense, it should be noted that the jQuery-UI documentation has never been reader-friendly. –  Boaz Mar 4 '13 at 13:15
show 3 more comments

1 Answer

up vote 5 down vote accepted

Did you look at the documentation?


Hiding the close button

In some cases, you may want to hide the close button, for instance, if you have a close button in the button pane. The best way to accomplish this is via CSS. As an example, you can define a simple rule, such as:

.no-close .ui-dialog-titlebar-close { display: none; }

Then, you can simply add the no-close class to any dialog in order to hide it's close button:

$( "#dialog" ).dialog({   dialogClass: "no-close",   buttons: [
      text: "OK",
      click: function() {
        $( this ).dialog( "close" );
    }   ] });
share|improve this answer
Now Dialog box not working at all, when I uncheck it nothing displays –  Customized Name Mar 4 '13 at 13:20
I dunno: jsfiddle.net/vLNWh –  aquinas Mar 4 '13 at 13:25
should I add javaScript function in my handlethis() function ? –  Customized Name Mar 4 '13 at 13:28
add comment

Your Answer


