Focus form field in dialog

Focus form field in dialog


Hi,
I have a form in a div that I have made into a jquery-ui dialog (with
effects). I'm trying to focus a field in this form with an option like
this:
show: 'drop',
hide: 'drop',
title: 'Log på',
open: function(event, ui) {
// todo focus in username field
$('#usernameField').focus();
},
I see the cursor placed in the field briefly but then focus is lost
again. If I disable the drop effect on "show" focus works fine. Any
ideas on how to place focus in a field *after* the effect has
completed?
Thanks,
-dennis