[jQuery] Re: filter(fn)

2009-03-11 Thread Bright Dadson
Thanks Karl, It worked perfect. On Tue, Mar 10, 2009 at 7:01 PM, Karl Swedberg wrote: > if(($out).filter(':contains(Invalid)')) > > > That is always going to be "true" since it returns a jQuery object > regardless of whether there are any matched elements. Try this instead: > if(($out).filter(':c

[jQuery] Re: filter(fn)

2009-03-10 Thread Karl Swedberg
if(($out).filter(':contains(Invalid)')) That is always going to be "true" since it returns a jQuery object regardless of whether there are any matched elements. Try this instead: if(($out).filter(':contains(Invalid)').length) --Karl Karl Swedberg www.englishrules.com www.lear

[jQuery] Re: filter(fn)

2009-03-10 Thread Liam Byrne
Hard to tell, since you haven't said what it is doing or what you're "expecting" it to do, but I think data should be {oname:name} Maybe that's what's wrong ? You'll also need a return false to prevent the standard form submit from kicking in brightdad...@googlemail.com wrote: Hi Expe

[jQuery] Re: filter(fn)

2007-09-15 Thread Pluthos
Wizzud, Thanks a million. I was under the false impression that filter also included the remove function. It does not. Your example is excellent. It should be included in the documentation for the beginners like me, who go astray. Pluthos On Sep 15, 12:41 am, Wizzud <[EMAIL PROTECTED]> wrote: >

[jQuery] Re: filter(fn)

2007-09-15 Thread Wizzud
Umm... there seems to be a slight misunderstanding here. In your first example (the commented-out one) the methods you are using will not affect the DOM in any way, shape or form. The filter() method simplify restricts the current element selection to those that match the specified criteria. In y

[jQuery] Re: filter(fn)

2007-09-14 Thread Pluthos
Thanks Klaus and Wizzud I really don't know what the problem is. Here is the latest thing I tried. // $ ("#app_content_2356318").children('div').children('table').filter(function(index) { return false; }) ; // does not works with or without the index as parameter. Nothing is removed $ ("#app_co

[jQuery] Re: filter(fn)

2007-09-10 Thread Wizzud
Yes, I must admit I did not test the actual documented example - I was heading more at the root of the problem, ie what wasn't working with Pluthos' script that caused him to try the example in the first place! Klaus Hartl wrote: > > > Pluthos wrote: >> Hi everyone, >> >> I am new to this gr

[jQuery] Re: filter(fn)

2007-09-10 Thread Klaus Hartl
Pluthos wrote: Hi everyone, I am new to this group. I have been trying to get filter(function) to work for a few days without success. My goal was to remove DOM elements that did not belong to a pre-arranged array. Out of desperation I tried the example given in the on line documentation at htt

[jQuery] Re: filter(fn)

2007-09-10 Thread Wizzud
The filter(function) works fine for me (jQuery v1.1.4) - return TRUE and the filter is applied (ie. the element is kept); return FALSE and the element is removed - so taking the documented example it would return "How are you?". The same effect (using the documented example again) can be achieve