Dynamic Button Names for jQueryUI.dialog()
So I'm stumped on this one. Does anyone have any idea how to create a dialog that uses dynamic values to control the names of the dialog's buttons? Here's what I've tried, but when I use the below code, I end up with a dialog that has button names of 'button1' and 'button2' rather than 'Yes' and 'No'. Any ideas?
- function conditionalDialog(button1, button2){
- $.dialog({
- autoOpen: true,
- title: 'Condition',
- modal:true,
- buttons:{
- button1: function(){
- //handle 'yes'
- },
- button2: function(){
- //handle 'no'
- }
- }
- });
- conditionalDialog('Yes', 'No');