I have this var
var mylabelname = "ok";
$( ".selector" ).dialog({ buttons: { mylabelname : function() { $(this).dialog("close"); } } });
so when it display it shows on the button "mylabelname" and not the value. How can I have the value show.
I have this var
var mylabelname = "ok";
$( ".selector" ).dialog({ buttons: { mylabelname : function() { $(this).dialog("close"); } } });
so when it display it shows on the button "mylabelname" and not the value. How can I have the value show.
Hmmm... I guess you cant make it happen. Your dialogue syntax is using JSON, which understands it's keys as strings not variables. It won't put mylabel's value there even if it's without quotes. I mean, in this syntax: {key: value}, if the value is without quotes, it will pass it's value, but the key won't.
You'll need to write th "ok" string instead of mylabel.