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
}
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam Collett
Sent: 18 October 2006 17:07
To: 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 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').get(0).hasClass("disabled") ){
    //don't submit the form
}
 
???
TIA.
 

Luc Pestille
Web Designer

e: [EMAIL PROTECTED]
t: +44 (0)1628 899 700
f: +44 (0)1628 899 701

 


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 discuss@jquery.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not discuss@jquery.com 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
discuss@jquery.com
http://jquery.com/discuss/



I think this should work:

if ( $('#myselect').is(":disabled") ){
    //don't submit the form
}

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to