[jQuery] Re: addClass only works once

2007-07-12 Thread Marc Jansen
Hi stef, Maybe you should explicitly removing the class 'show' before asdding the class hidden: $(#dimensions).removeClass(show).addClass(hidden) -- Marc stef schrieb: Im using the code below to display / hide form fields depending on what value is selected from a drop down list

[jQuery] Re: addClass only works once

2007-07-12 Thread Klaus Hartl
stef wrote: Im using the code below to display / hide form fields depending on what value is selected from a drop down list (id='category'). the optional form fields are all hidden by default when DOM is ready, using $(document).ready(function() { $(#dimensions).addClass(hidden)

[jQuery] Re: addClass only works once

2007-07-12 Thread Stephan Beal
On Jul 12, 2:15 pm, stef [EMAIL PROTECTED] wrote: else if ($(#category).val() == accessoires) Are you sure that's correct? accessories is spelled wrong. i can't see if it's also misspelled in your code, so i can't judge if that's the problem or not. i am,

[jQuery] Re: addClass only works once

2007-07-12 Thread stef
accessories was spelt wrongly indeed but not the cause of the problem. first two replies corrected the issue. thanks alot guys! On Jul 12, 2:36 pm, Stephan Beal [EMAIL PROTECTED] wrote: On Jul 12, 2:15 pm, stef [EMAIL PROTECTED] wrote: else if ($(#category).val() ==

[jQuery] Re: addClass only works once

2007-07-12 Thread Sam Collett
Have you tried using .hide() and .show() instead of addClass? Less code (both JavaScript and CSS). Unless the class 'show' has more than just display: inline? On Jul 12, 1:15 pm, stef [EMAIL PROTECTED] wrote: Im using the code below to display / hide form fields depending on what value is

[jQuery] Re: addClass only works once

2007-07-12 Thread stef
will the line below work even if there is no class hidden to remove - will the addClass part still work? Im thinking it wont ... $(#dimensions,#inthebox).removeClass(hidden).addClass(show) On Jul 12, 4:43 pm, stef [EMAIL PROTECTED] wrote: accessories was spelt wrongly indeed but not the cause

[jQuery] Re: addClass only works once

2007-07-12 Thread Klaus Hartl
stef wrote: will the line below work even if there is no class hidden to remove - will the addClass part still work? Im thinking it wont ... $(#dimensions,#inthebox).removeClass(hidden).addClass(show) It will! --Klaus