Unable to give focus to specific fields with jQuery
<p>I'm validating a simple form with jQuery:</p>

<pre><code>$('input:text').blur(function(){
  if ($(this).val() == "") {  
    $("#" + $(this).attr("name") + "_error").show();  
    $(this).css("border", "2px solid red");
    $(this).focus();
    return false;  
  }
});
</code></pre>

<p>The <code>$(this).focus();</code> doesn't keep the focus on the current field - is there a reason this shouldn't be allowed, or am I missing something? </p>

<p><strong>UPDATE</strong></p>

<p>I've been playing around with the code a little; when I try to focus a specific field by selecting it by its id, the focus will never remain on the field that the <code>blur</code> event was called from; for example if I've got 5 fields, with ids <code>field1</code>, <code>field2</code>,...<code>field5</code>, and have the following code:</p>

<pre><code>$('input:text').blur(function(){
  if ($(this).val() == "") {  
    $(this).css("border", "2px solid red");
    $("#field4").focus();
    return false;  
  }
});
</code></pre>

<p>if I take the focus away field 1 when it is empty using the tab key, then the focus <em>is</em> switched to <code>#field4</code>, however, if I tab off field 4 when it is empty, the focus does not remain on field 4, but switches to field 5.  Is this expected / documented behaviour?</p>
