views:

14

answers:

1

i have a jquery dialog with this configuration:

$("#someForm").dialog({

    modal: true,
    title: 'Registration',
    resizable: false,
    draggable: false
});

$("#someForm").dialog( "option", "buttons", {
    "Sign Up": function() {
        doSomething();
        $(this).dialog("close");
     },
    "Cancel": function() {
        $(this).dialog("close");
     }

} );

$("#afieldintheform").focus();

when i press the TAB key it tabs through the inputs fine, but it doesn't reach the cancel or sign up button and instead tabs to the browser's address bar...

any help is greatly appreciated!

thanks.

A: 

The example at http://jqueryui.com/demos/dialog/#modal-form works fine.

Try to initialize it like the following:

    $("#someForm").dialog({
        modal: true,
        title: 'Registration',
        resizable: false,
        draggable: false,
        buttons: {
             "Sign Up": function() {
                 doSomething();
                 $(this).dialog("close");
             }, 
             "Cancel": function() {
                 $(this).dialog("close");
             }
        }
  });

What version of jQuery are you using? What browser?

cesarnicola
I tried the initialization as you described, but it still doesn't work. I tested the example and it has the same problem also.jquery 1.4.2,jquery-ui 1.8.2firefox: doesn't work,chrome: works,safari: doesn't work
hmak
I tried it with chrome... Maybe a jQuery bug? :S
cesarnicola
hmmm...looks like to get it to work in firefox and safari on mac, you need to do this! chrome is a rebel.http://support.mozilla.com/en-US/kb/Pressing+Tab+key+does+not+select+menus+or+buttons
hmak
Hmm... that's tricky :/
cesarnicola