Questions tagged [drop-down-menu]

A GUI element, similar to a combobox and a list box, which allows the user to choose one value from a list. When a drop-down list is inactive, it displays a single value. When activated, it displays (drops down) a list of values, from which the user may select one.

Sometimes referred to as a pull-down menu, drop-down list, or drop-down box, a dropdown menu is a list of items that appear when clicking on a button or text selection. For example, many programs have a "File" drop down menu at the top left of their screen. Clicking on the "File" text generates a new menu with additional options.

Drop-down list on Wikipedia

Drop-down list image from Wikipedia

21877 questions
96
votes
10 answers

How to select/get drop down option in Selenium 2

I am converting my selenium 1 code to selenium 2 and can't find any easy way to select a label in a drop down menu or get the selected value of a drop down. Do you know how to do that in Selenium 2? Here are two statements that work in Selenium 1…
user786045
  • 2,498
  • 4
  • 22
  • 18
93
votes
11 answers

set dropdown value by text using jquery

I have a dropdown as: In the above dropdown i know the text of the dropdown. How can set the value of the…
Prasad
  • 58,881
  • 64
  • 151
  • 199
93
votes
19 answers

Adding a slide effect to bootstrap dropdown

I'm using bootstrap, and I'd like to add animation to a dropdown. I want to add an animation to it, slide down and back up when leaving it. How could I do this? Things I tried: Changing the Js drop down file like this: How can I make Bootstrap's…
Ben Beri
  • 1,101
  • 4
  • 23
  • 64
92
votes
27 answers

Dropdownlist width in IE

In IE, the dropdown-list takes the same width as the dropbox (I hope I am making sense) whereas in Firefox the dropdown-list's width varies according to the content. This basically means that I have to make sure that the dropbox is wide enough to…
Nimesh Madhavan
  • 6,290
  • 6
  • 44
  • 55
90
votes
11 answers

Enable/Disable a dropdownbox in jquery

I am new to jQuery and I want to enable and disable a dropdown list using a checkbox. This is my html: I would like to open the list (the same as left-clicking on it). Is this possible using JavaScript (or more specifically jQuery)?
Jon Tackabury
  • 47,710
  • 52
  • 130
  • 168
88
votes
8 answers

Percentage calculation

I am working in progress bar concept in ASP.NET MVC 2. Here i have a DropDownList which has 10 values. i want to calculate the percentage for progress bar, e.g. 10 values from DropDownList and i am having a query which returns the value 2. so, out…
RobinHood
  • 2,367
  • 11
  • 46
  • 73
87
votes
10 answers

There is no ViewData item of type 'IEnumerable' that has the key 'xxx'

There are a couple of posts about this on Stack Overflow but none with an answer that seem to fix the problem in my current situation. I have a page with a table in it, each row has a number of text fields and a dropdown. All the dropdowns need to…
Jimbo
  • 22,379
  • 42
  • 117
  • 159
87
votes
3 answers

How do I set the HTML options for collection_select in Rails?

I can't seem to find the syntax to add a class to a select tag generated by Rails collection_select. Some help?
tybro0103
  • 48,327
  • 33
  • 144
  • 170
86
votes
13 answers

How to make a drop down list in yii2?

How to make a dropdown in yii2 using an activeform and a model? Since all the methods has changed in yii2,how it is done in the new one?
Dency G B
  • 8,096
  • 9
  • 47
  • 78
81
votes
7 answers

Aligning text and select boxes to the same width in CSS?

Ok this is seemingly impossible to get right. I have a text box and a select box. I want them to be the same width exactly so they line up on the left margin and the right margin.