Alex Rivera | Logout

Jquery dialog : Hide the button

Asked 2012-07-16T12:37:22.357
17

I am using Jquery's dialog() method to create dialog. I am creating buttons on the dialog while creating the dialog, using

      $("#divName").dialog({
            buttons:
            {
            "Cancel":{

I have one event on which I need to hide the button,but don't know which attributes to use. Please tell me the attributes to hide button. Thanks in advance.

Edit
Report

1 Answer

7

When you create the dialog, you describe the buttons and the attributes of the buttons, so add an "id" attribute to the button:

buttons: [ { text: "Save", id: "btnId", click: function() { ... } } ]

You can then use the id as a jquery filter for the hide() and show() methods:

$("#btnId").hide()...

answered 2013-05-10T07:22:28.197

Your Answer