[jQuery] Re: Focus First 'visible' field

2008-04-22 Thread Jacky See
Someone found that this method does not handle visibility correctly. When a visibility:hidden parent with a visibility:show child, the child would override its parent's property (of course!). So the script only need to check display:none parent, which would introduce another filter:

[jQuery] Re: Focus First 'visible' field

2008-04-22 Thread Erik Beeson
Your inner $(this).filter(...) doesn't make sense to me. This works for me on FF2/Mac: $(':input:visible').filter(function() { return $(this).parents(':hidden').length == 0; }).slice(0,1).focus(); That is: Select all visible inputs elements, filter out any who have parents which are

[jQuery] Re: Focus First 'visible' field

2008-04-22 Thread Jacky
This is my very first implementation. But it fails on visibility:hidden parent which has a visibility:show child. You may try the updated demo page. Box 11 would still be visible even when you toggle its parent's visibility. http://www.seezone.net/dev/focusField.html ':hidden' selector would try

[jQuery] Re: Focus First 'visible' field

2008-04-17 Thread Jacky
To work on any type of input should be easy, just replace ':text' with input. I know that IE would give error when you're focusing a 'disappearing' input. (parent is hidden, for example). But I do not encounter any error like you described. Any sample code for your HTML? On Tue, Apr 15, 2008 at

[jQuery] Re: Focus First 'visible' field

2008-04-14 Thread MichaelEvangelista
I've been looking for a solution like this, but that will work with any type of form input. The code I've been using is below (where form-id is the ID of the containing form) It works great in Firefox but IE throws the error 'this.parentNode.borderCss.on' is null or not an object I tried your