Hi all,
:disabled doesn't want to work as I expect - when I submit with a
"disabled" option selected, the whole select drop down becomes disabled
(or rather the class is added to ALL the options). I've added my real
code in below, rather than working with hypotheticals - any more ideas?


// if option is "disabled", don't submit it
if( $('#idol_date_day1').is(":checked") && $('#idol_datetime_day1
option:disabled') ){
        // add class to change colour
        $('#idol_datetime_day1
option: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 Methvin
Sent: 18 October 2006 17:54
To: 'jQuery Discussion.'
Subject: Re: [jQuery] Checking select option has class?

 
> $('#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
[email protected]
http://jquery.com/discuss/ 

In2
Thames House
Mere Park
Dedmere Road
Marlow
Bucks
SL7 1PB

Tel 01628 899700
Fax 01628 899701
e: [EMAIL PROTECTED]
i: www.in2.co.uk

This message (and any associated files) is intended only for the use of 
[email protected] and may contain information that is confidential, subject to 
copyright or constitutes a trade secret. If you are not [email protected] you 
are hereby notified that any dissemination, copying or distribution of this 
message, or files associated with this message, is strictly prohibited. If you 
have received this message in error, please notify us immediately by replying 
to the message and deleting it from your computer. Messages sent to and from us 
may be monitored. Any views or opinions presented are solely those of the 
author [EMAIL PROTECTED] and do not necessarily represent those of the company.

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to