Re: [jQuery] Checking select option has class?

2006-10-19 Thread David Duymelinck
Luc Pestille schreef: > // add class to change colour > $('#idol_datetime_day1 > option:disabled').addClass("required").get(0).focus(); > change to $('#idol_datetime_day1 option:disabled').addClass("required").eq(0).focus(); This seems to be a common mistake. Maybe on one of the l

Re: [jQuery] Checking select option has class?

2006-10-19 Thread Luc Pestille
on:disabled').addClass("required").get(0).focus(); return false; }else{ $('#idol_datetime_day1 option:disabled').removeClass("required"); } Thanks, Luc -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Me

Re: [jQuery] Checking select option has class?

2006-10-18 Thread Dave Methvin
> $('#myselect option').is(":disabled").addClass('disabled'); .is() isn't chainable, but you can just add :disabled to the selector: $('#myselect option:disabled').addClass('disabled'); ___ jQuery mailing list discuss@jquery.com http://jquery.com/di

Re: [jQuery] Checking select option has class?

2006-10-18 Thread Klaus Hartl
Luc Pestille schrieb: > Nope, that didn't work - I suspect (read:complete guess) because > #myselect is the select element itself, not the option within it. Anyone > else offer a solution? > > if ( $('#myselect').is(":disabled") ){ > //don't submit the form > } $('#myselect option').is("

Re: [jQuery] Checking select option has class?

2006-10-18 Thread Luc Pestille
[mailto:[EMAIL PROTECTED] On Behalf Of Sam CollettSent: 18 October 2006 17:07To: jQuery Discussion.Subject: Re: [jQuery] Checking select option has class? On 18/10/06, Luc Pestille <[EMAIL PROTECTED]> wrote: Hi all, Thanks to IE's

Re: [jQuery] Checking select option has class?

2006-10-18 Thread Sam Collett
On 18/10/06, Luc Pestille <[EMAIL PROTECTED]> wrote: Hi all, Thanks to IE's wonderful ommission of disabled="disabled" for options in select drop downs, I need to add a class to disabled options and and check for that class when the form is submitted. How do I check the selected

[jQuery] Checking select option has class?

2006-10-18 Thread Luc Pestille
Hi all, Thanks to IE's wonderful ommission of disabled="disabled" for options in select drop downs, I need to add a class to disabled options and and check for that class when the form is submitted. How do I check the selected option has a class within a select?   if ( $('#myselect'