If you're wanting the text field to retain focus no matter what then
you should probably reconsider. It's not a very good thing from a UI
design perspective. It is possible but it pretty much "locks up" the
entire browser.

Having given you the "don't shoot yourself or the user in the foot"
warning, here's code to do it:

$('input#MyTextInput').blur( function() {
   var input = this;
   setTimeout( function() {
       input.focus();
   }, 0);
});

Tested and working in IE and Firefox.

Karl Rudd

On 5/25/07, Glen Lipka <[EMAIL PROTECTED]> wrote:
Code sample:
$("input#MyTextInput").blur(
  function() {
    setTimeout("$('#MyTextInput').focus()",0);
   }
);

 That works in FF.
----------------------
$("input#MyTextInput").blur(
   function() {
     $('#MyTextInput').focus();
   }
 );

That does not work in FF.
---------------------

Trying to re-focus back on an input after a blur event.
IE works in more circumstances, but FF does not.

Is there an easier way?

Glen

Reply via email to