jQuery: The Write Less, Do More JavaScript Library

How to get associate the enter key with the jquery ok button

View: New views
7 Messages — Rating Filter:   Alert me  

How to get associate the enter key with the jquery ok button

by anitha john :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.



Re: How to get associate the enter key with the jquery ok button

by Mean Mike :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the answer you seek is behind this link =>
http://groups.google.com/group/jquery-ui/browse_thread/thread/4d9515d033b3d3ab/c2b7c9378e03864f?lnk=gst&q=enter+key#c2b7c9378e03864f

i found with a quick search of this group

Mean Mike



On Nov 10, 2:27 am, anitha john <anithajohnp...@...> 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 jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.



Re: Re: How to get associate the enter key with the jquery ok button

by Kilhom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I dont think your message is for me, did you make a mistake ? :)

Bye

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.

Re: Re: How to get associate the enter key with the jquery ok button

by Kilhom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry it's my bad.
I didnt know that google send you a message for every answer on the group !
Sorry again, bye.

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.

Re: How to get associate the enter key with the jquery ok button

by Mean Mike :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <mcgra...@...> 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 <anithajohnp...@...> 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 jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.



Re: How to get associate the enter key with the jquery ok button

by Mean Mike :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have no idea what you are talking about I simply replayed to this
post made by Anitha John maybe you are confused because you get emails
on every subject ?

On Nov 10, 8:19 am, kilhom <kil...@...> wrote:
> Hi, I dont think your message is for me, did you make a mistake ? :)
>
> Bye

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.



Re: Re: How to get associate the enter key with the jquery ok button

by anitha john :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks mike....

On Tue, Nov 10, 2009 at 7:38 PM, Mean Mike <mcgrailm@...> wrote:
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 <mcgra...@...> 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 <anithajohnp...@...> 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 jquery-ui@....
To unsubscribe from this group, send email to jquery-ui%2Bunsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.





--
Kind words can be short and easy to speak, but their echoes are truly endless........ Mother Teresa
Regards,

Anitha

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.