Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
133
rated 0 times [  136] [ 3]  / answers: 1 / hits: 22263  / 12 Years ago, wed, april 25, 2012, 12:00:00

Is it possible to set the ID for the buttons in a jQuery UI dialog, so that I can refer to them later through jQuery? For example, trigger events, disable etc?



... in the dialog setup ...
buttons: {
Sök: function () {
var bValid = true;
},
OK: function () {
if (OK()) {
getStuffNoteringar($(#txtStuffId).val());
$(this).dialog(close);
}
}

.... later on in some javascript code....

$('#OK').click();

More From » jquery

 Answers
87
$(#myDialog).dialog({
buttons : {
MyButton : {
text: OK,
id: okbtnid,
click: function(){
var bValid = true;
}
}
}
});

[#85992] Tuesday, April 24, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alekgermanb

Total Points: 616
Total Questions: 86
Total Answers: 105

Location: Aland Islands
Member since Thu, Dec 23, 2021
2 Years ago
;