that said I didn't like the fact that it was always checking
"keypress" so I did it like this
$("#mydialog").dialog({
open: function() {
$(document).keypress(function(e) {
if ((e.which && e.which == 13) || (e.keyCode
&&e.keyCode == 13)) {
$('[aria-labelledby$=mydialog]').find(":button:contains
('Ok')").click();
}
});
},
close: function (){
$(document).unbind('keypress');
},
buttons: {
Ok: function() {
alert("you clicked ok ");
},
Cancel: function() {
$(this).dialog('close');
}
}
});
On Nov 10, 8:15 am, Mean Mike <[email protected]> wrote:
> the answer you seek is behind this link
> =>http://groups.google.com/group/jquery-ui/browse_thread/thread/4d9515d...
>
> i found with a quick search of this group
>
> Mean Mike
>
> On Nov 10, 2:27 am, anitha john <[email protected]> wrote:
>
> > I am using jquery ui dialog.
> > On click of enter i want to fire the ok click. How do I acheive this?
> > Please Help!!!
--
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=.