[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Thomas Allen
Good call; thanks! I've been working with the Validate plugin, and the "depends" guards appear to be creeping into my other code :^) Thomas On Feb 10, 2:41 pm, Ricardo Tomasi wrote: > Doh. I'm blind. > > $("#pay_cc:checked") will always be 'true'. even if the element is not > found an object wi

[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Ricardo Tomasi
Doh. I'm blind. $("#pay_cc:checked") will always be 'true'. even if the element is not found an object will be returned. You have to check for .length or size () if($("#pay_cc:checked").length) showCC(); if($("#pay_check:checked").length) showCheck(); cheers, - ricardo On Feb 10, 5:29 pm, Thom

[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Thomas Allen
It works fine for the focus event. The purpose of the conditionals is to ensure that the correct payment field pops up if the page is reloaded/revisited. For whatever reason, on a page reload, showCheck() always fires, even line 1's condition returns true and line 2's returns false (I've tested th

[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Ricardo Tomasi
What do you mean by overriden? Just copied your code over and it seems to work fine. http://jsbin.com/efeje http://jsbin.com/efeje/edit - ricardo On Feb 10, 3:07 pm, Thomas Allen wrote: > Here's my JS:http://pastebin.com/m6091a365 > And the accompanying HTML:http://pastebin.com/m30c57ea6 > > F