In HTML DOM, the selectedIndex property sets or returns the index of the selected option in a dropdown list. The index starts at 0.
Questions tagged [selectedindex]
354 questions
5
votes
3 answers
value of select elements with "e.value" vs "e.options[e.selectedIndex].value"
Given the HTML:
and the javascript:
var e = document.getElementById('mySelect');
To get the value of…

Rikard
- 7,485
- 11
- 55
- 92
5
votes
1 answer
asp.net radiobuttonlist will not selectindex
I have a radio button list...

Stuart
- 1,544
- 5
- 29
- 45
4
votes
4 answers
Using JavaScript and JQuery, How Can I Maintain the Selected State of a Dynamically-Updated HTML Select Element?
I have a form UI whereby several sections require duplicate HTML select list to be updated dynamically from a single, dynamically-updatable select list.
The dynamically-updatable list works just fine, in that new options can be added and removed…

lincolnberryiii
- 623
- 14
- 25
4
votes
2 answers
How to implement Hold in Listbox?
If hold the listbox, I want to get listbox index.
This is my code:

Jeeva
- 1,166
- 4
- 18
- 39
4
votes
2 answers
UITabBarController Weirdness ?
If I normally load up a UITabBarController and switch between views, it calls the viewWillAppear of each view controller.
But it is not so.
I want to switch to another tab as soon as another tab is touched.
If I specify a tab to load up - for…

Legolas
- 12,145
- 12
- 79
- 132
4
votes
2 answers
programmatically select next listbox item
I'm trying to program two buttons to imitate the up/down arrow key behavior, meaning that when I press the button for up, it moves up one item in my listbox and so on. I wrote the following code:
private void mainlistup(object sender,…

internetmw
- 689
- 5
- 13
- 33
4
votes
2 answers
ComboBoxItem to full width of ComboBox, when using SelectedIndex, or navigating keyboard?
Following XAML causes the "My stuff" being centered of ComboBox until I open the ComboBox, when it correctly stretches itself.

Ciantic
- 6,064
- 4
- 54
- 49
4
votes
6 answers
Select next item in ListView
I have a method that removes currently selected item in a ListView
listView1.Items.Remove(listView1.SelectedItems[0]);
How do I select the next in the ListView after removing the selected one?
I tried something like
var index =…

Abraham
- 1,209
- 2
- 14
- 22
3
votes
2 answers
retain dropdown selection on refresh
Possible Duplicate:
retaining selected dropdown option on postback
I have a dropdown when user selects the option, the value is passed on to the same url as querystring refreshing the page. after the page refreshes i wanna retain the selected…

Anjana Sharma
- 4,535
- 5
- 37
- 51
3
votes
1 answer
selecteditems and selectedindex c#
I'm new to C# and I'm starting to learn how to program
I'm learning to program into the Visual Studio Microsoft Edition where I use the WindowsApplication instead of the Console.
While trying to make this code, I encountered this command:
Selected…

tintincutes
- 5,618
- 25
- 67
- 86
3
votes
3 answers
Why doesn't my GridView SelectedIndexChanged event fire?
I have a GridView which you can click on a row and it should call the SelectedIndexChanged method (which updates another part of the page based on which row was selected). I have done something similar to this before and it worked, but I can't seem…

jdtaylor
- 334
- 2
- 5
- 20
3
votes
3 answers
Listbox SelectionChanged firing when setting to -1 within function, wp7
I am running into a very odd problem in c# and I just wanted to know what is causing this. I have my theories, but not entirely sure and just want to see if it can be reproduced.
Standard Pivot Page in wp7 silverlight 4.
…

Shaun Doty
- 125
- 1
- 9
3
votes
0 answers
UITabBarController selectedIndex/selectedViewController does not color tab on iOS 13
At app startup, on iOS 13, setting my UITabBarController's selectedIndex or selectedViewController does show the correct view controller, but all tab icons remain grey.
I do this in AppDelegate and it's been working for years and still is working…

meaning-matters
- 21,929
- 10
- 82
- 142
3
votes
2 answers
How can I speed up jquery :selected selector?
I have a dropdown in a web page with 3830 elements in it. I know, excessive but whatever.
In jquery I get the selected option value using the statement:
$( "#institutionCombo :selected" ).val();
There is a noticeable pause before the selection is…

Craig
- 770
- 3
- 14
- 26
3
votes
1 answer
selectedRows() in Qml TreeView with ExtendedSelection is one step behind
I have a treeview in the qml, the selection mode is ExtendedSelection. Whenever the selected index changes by the user I need to exactly know which tree rows are selected. Here is the TreeView:
Controls.TreeView {
id: myTreeView
…

Ehsan Enayati
- 299
- 2
- 16