All DropDown

Common Dropdown operation (Get, Set, Add, Remove) using jQuery

DropDown list is a very basic and common control and You might be using either ASP.NET Dropdown list or normal html dropdown list in your project. In this post, I have put together the code examples for all kind of dropdown operation. For example, to get selected value from dropdown, for to set value in […]
Read the rest of this entry »

How to Reset dropdown using jQuery

In this post, you will find various ways to reset the dropdown using jQuery. These are one line of jQuery code, which can reset the dropdown. Below code will find the first item in the list and make it selected. $('#DropDownList1').find('option:first').attr('selected', 'selected'); Below code will find the item with value o and selects it. If […]
Read the rest of this entry »

Add default option to ASP.NET Dropdown list using jQuery

Sometimes It is required to add default option like "Please Select" or "Select" in Dropdown list. Below is a simple jQuery code to "add default option to ASP.NET Dropdown list using jQuery". //Code Starts $(document).ready(function(){ var defaultOpt = "<option selected='selected' value='-1'>--Select--</option>" $('#<%=ddlCountry.ClientID %>').prepend(defaultOpt); }) //Code Ends And if you want to add default option to […]
Read the rest of this entry »

How to add images in DropDown List Items using jQuery

DropDown contains list of items out of which user can select one. But have you ever thought of having images along with the description? For example, showing country flag image with country name in dropdown. It will look more attractive and eye catching. But How to do it? Well, there is a jQuery Plugin "ddSlick" […]
Read the rest of this entry »

How to Disable DropDown List Item using jQuery

In this post, I will show you how you can disable specific items of the DropDown/ComboBox/Select element using jQuery. To disable any item, just need to add attribute "disabled" with value "disabled" to the list item. //Code Starts $(document).ready(function() { $("#ddlList option[value='jquery']").attr("disabled","disabled"); });? //Code Ends See result below. You can also disable item by their […]
Read the rest of this entry »

Fix for “IE Select DropDown with Fixed width issue” using jQuery

Today I found another reason to hate IE. I ran into an issue where Select DropDown with Fixed width cuts off the options text (if it is wider than the assigned width) only in IE (Internet Explorer). In this post, I will show you the fix for this problem using JavaScript and jQuery both. Problem […]
Read the rest of this entry »

Responsive Menu
Add more content here...