Show form field and focus
<p>In have a selector and when I select a particular option it shows additional form field. At that point I want to switch the focus to the new field. Here's what I tried but it does not seem to work. What am I missing?:</p>

<pre><code>   $('#mySelector').change(function () {
        var st = $(this).val();
        if (st == 'a') {                
            $('#a').show(function(){
                $('#aField').focus();
            });
            $('#b').hide();
        } else if (st == 'b') {
            $('#a').hide();
            $('#b').show(function(){
                $('#bField').focus();
            });             
        } else {
            $('#a, #b').hide();
        }
    });
</code></pre>
