Disable select if options are empty

Javascript coding ..

Moderators: macek, egami, gesf

lvidya
New php-forum User
New php-forum User
Posts: 37
Joined: Wed Jun 20, 2012 3:20 am

Disable select if options are empty

Postby lvidya » Thu Aug 30, 2012 11:26 pm

hai, how to disable a select box if it has no options?????????

User avatar
TomCornar
New php-forum User
New php-forum User
Posts: 25
Joined: Fri Sep 14, 2012 12:06 am

Re: Disable select if options are empty

Postby TomCornar » Sun Sep 16, 2012 11:32 pm

Try this,

$('select:not(:has(option))').attr('disabled', true);

Regards,
Tom Cornar
Trinay Technology Solutions
http://www.trinay.com


Return to “JavaScript”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest