Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

Disable select if options are empty

Javascript coding ..

Moderators: macek, egami, gesf

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?????????
lvidya
New php-forum User
New php-forum User
 
Posts: 37
Joined: Wed Jun 20, 2012 3:20 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
User avatar
TomCornar
New php-forum User
New php-forum User
 
Posts: 25
Joined: Fri Sep 14, 2012 12:06 am


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.