Hi,
I'm using jquery ui to pop up some dialog for my user. Most of the time my dialog have a cancel button to close or Ok button to validate the action.
How can i add the support of the return key (code 13) for the "Ok" button
You can find below how i'm setting up my dialog :
- $('#heure_dialog').dialog({
- bgiframe:true,
- autoOpen:false,
- height:150,
- modal:true,
- close:function(){
- $('#heure').val('');
- }
- });
So , how can i add a keypress event on the "OK" button ?
- $('#heures td').click(function(){
- $('#heure_dialog').dialog('option','buttons',{
- 'OK':function(){
- // Do something when this button is clicked or Return is pushed
- },
- 'Cancel' : function(){
- $(this).dialog('close');
- }
- });
- $("#heure_dialog").dialog("open");
- });
Thanks for your help and i apologize for my approximative english.