# How to hide or remove default cancel in Atlassian dialog

**URL:** <https://community.developer.atlassian.com/t/how-to-hide-or-remove-default-cancel-in-atlassian-dialog/25372>\
**Category:** Everything Else\
**Tags:** dialog, ac-express, add-on, atlassian-connect, confluence-developers\
**Created:** [December 5, 2018, 12:53pm UTC](https://community.developer.atlassian.com/t/how-to-hide-or-remove-default-cancel-in-atlassian-dialog/25372 "2018-12-05T12:53:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnyan.suluganti](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gnyan.suluganti](https://community.developer.atlassian.com/u/gnyan.suluganti)\
**Post date:** [December 5, 2018, 12:53pm UTC](https://community.developer.atlassian.com/t/how-to-hide-or-remove-default-cancel-in-atlassian-dialog/25372/1 "2018-12-05T12:53:58Z")

</div>

```auto
AP.require('dialog', function(dialog) {
  dialog.create({
    key: 'my-key',
    width: '1024px',
    height: '630px'
  }).on("close", function () {
    console.log("dialog closed");
  });
  AP.dialog.getButton('submit').hide();
  AP.dialog.getButton('cancel').hide();
});

```

I need to hide or remove both submit and cancel buttons which comes in the dialog box by default (other than putting “chrome” : false)

**AP.dialog.getButton(‘submit’).hide();** this is working submit button gets removed .

**AP.dialog.getButton(‘cancel’).hide();** this is not working

Any solution to hide default cancel button ?

Thanks in advance
