0

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.

http://jqueryui.com/demos/dialog/#option-buttons

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.