[jQuery] Re: text box keeps focus when another element type is clicked ?

2008-06-09 Thread paulj
Wizzud Thank you *very* much. Your solution works fine. Paul On 8 Jun, 08:47, Wizzud [EMAIL PROTECTED] wrote: Try adding... $(':text').bind('focus', function(){ hasFocus = $(this); }); On Jun 5, 7:43 pm, paulj [EMAIL PROTECTED] wrote: Wizzud, thank you for your help. Your code

[jQuery] Re: text box keeps focus when another element type is clicked ?

2008-06-08 Thread Wizzud
Try adding... $(':text').bind('focus', function(){ hasFocus = $(this); }); On Jun 5, 7:43 pm, paulj [EMAIL PROTECTED] wrote: Wizzud, thank you for your help. Your code worked perfectly if the user had entered the text box by *clicking* on it. But, if the user has *tabbed* to the text

[jQuery] Re: text box keeps focus when another element type is clicked ?

2008-06-05 Thread Wizzud
Any good for you ... ? $(document).ready(function(){ var hasFocus = $(':text:first').focus(); $(document).bind('click', function(event){ var ev = $(event.target); if(ev != hasFocus){ if (ev.is(':text')){ hasFocus = ev; } hasFocus.focus(); } }); });

[jQuery] Re: text box keeps focus when another element type is clicked ?

2008-06-05 Thread paulj
Wizzud, thank you for your help. Your code worked perfectly if the user had entered the text box by *clicking* on it. But, if the user has *tabbed* to the text box (and then clicks on another element) the focus is returned to the text box that was last *clicked* on. This can be seen in my