javascript - How can I change the text of a DIALOG button after initialize? -


I wrote a dialog definition, but the name of the buttons depends on the situation. When I open the dialogue, I want to set the button name. Here is my dialog code:

  $ ("#neueFrage") .dialog ({resizable: how to change the name of dialog button after defining it) False, autoOpen: false, height: 900, width: 1100, model: true, passOnScope: false, open: function (event, UI) {$ (".ui-dialog-titlebar-close"). Button: [{text: 'SAVE', class: 'dialogbutton', click: function () {}}, {Text: 'CANCEL', category: 'dialog box', click: function () {}}]} );  

I communicate with this small code sample. If 'yes', everything is fine, but if not, then I want to change the name of the button for 'REDO'.

  if ($ (this) .text () == "yes") {$ ("#neueFrage") .dialog ("open"); } Else {// Open Dialog $ ("#neueFrage") .dialog ("open"), change the button 'save' to 'radio'; }  

How can I change the name of the button in and ?

try it:

  button: [{text: 'save Click on: function () {}, id: "class: 'dialogbutton', click: function () {}, id:" Savebtn "}, {text: 'CANCEL', category: 'dialog box' Cancelbtn "}]}); If ($ (this) .text () == "yes") {$ ("#neueFrage") .dialog ("open"); } And {$ ("# savebtn"). Search ("span"). Text ("whatever") $ ("#neueFrage") .dialog ("open"); }  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -