I want to open a jQuery UI dialog box and the box will have an input field which will take username. I want that when user presses the OK key on the dialog box, the dialog should return the username back to jQuery somehow
$("#dialog").dialog({
autoOpen: false,
width: 600,
buttons: {
"Ok": function() {
$(this).dialog("close");}}
});