selectedindex

Get selected value of option with multiple dropdown menus using javascript

限于喜欢 提交于 2019-12-12 16:40:33
问题 I have multiple features that have multiple options that need to be updated when an option is selected. I also need to pass a third piece of data through the attribute element. .getElementById() works for a single dropdown menu, but how do I get it to work when there are multiple menus on the page? I have tried var e = document.getElementsByClassName("testClass"); which did not work. I also tried to create optionsText & optionsValue in the same way that optionsFtr is created with var

How can I speed up jquery :selected selector?

匆匆过客 提交于 2019-12-12 16:02:39
问题 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 found. Once I get that value I insert it into a textbox on the page, so I know how fast. Plus I've checked it using breakpoints in Firebug. If I go old school and use this javascript: var div = document.getElementById( "maindiv" ); var select = div

Retrieving row index from UIPickerView and using it in a if statement

假如想象 提交于 2019-12-12 02:38:10
问题 Again forgive me if im not being clear, I have only started iOS dev yesterday. So I have a application that is going to send information to specific email address. I have included a pickerview and populated it with an array of information, 5 or 6 different categories. What i want to do is to be able to change the recipient's of the email based on what category is selected in the pickerview. So far I have but selectedRowInComponent doesn't seem to work. - (IBAction)sendFinalItem:(UIButton *

write labels for <option> tags based on selectedIndex using JavaScript

感情迁移 提交于 2019-12-11 18:17:46
问题 This next question works in conjunction with the question I posted at loading text into textarea based on drop down selection That has been solved and I have templates posting to text boxes based on drop down selection using: var showLeftTemplates = function(sel) { var locations = [ "template 1", "template 2", "template 3", "template 4", "template 5", ]; var srcLocation = locations[sel.selectedIndex]; if (srcLocation != undefined && srcLocation != "") { document.getElementById('LeftTemplates'

Windows phone listpicker set selectedIndex

此生再无相见时 提交于 2019-12-11 17:43:45
问题 I have run into a problem with the listpicker. I have a settings page with a option called "Decimals" where you can toggle a "Toggleswitch" and if you turn the toggle on, the listpicker gets enabled. Now when you click on the listpicker, you can choose from 1 to 5 as the amount of decimals. If you choose for example the number "3" in the listpicker, it will get saved to a key on isolated storage with the value 3, if you go to the MainPage it will check the isolatedstorage and if it contains

loading text into textarea based on drop down selection

喜欢而已 提交于 2019-12-11 12:40:31
问题 To start, I have searched the site and found this: How to fill in a text field with drop down selection but it did not suit my needs, as I'm generating very long templates and the above method would be too time consuming and impractical as it would mean filling in the value attribute of each <option> tag with my templates. So here's the code: <script type="text/javascript"> //<![CDATA[ function showCSTemplates(sel){ locations =[ "", /*this remains blank for first selection in drop-down list*/

JSF o:tabbedPane issue changing SelectedIndex

喜欢而已 提交于 2019-12-11 10:48:36
问题 im working with JSF 2.0 and the OpenFaces <o:tabbedPane> im having some troubles changing the tabs.. i have an index with four jsf pages includes. like this <o:tabbedPane loadingMode="client" tabGapWidth="3" id="pestana" tabClass="tab_form" rolloverTabClass="tab_form2" selectedTabClass="tab_form3" tabAlignment="bottomOrRight" style="width:100%;" binding="#{GeneralBean.panelTabs}"> <o:subPanel caption="1" styleClass="pestanas"> <ui:include src="/datosDeLaCotizacion.jsf"/> </o:subPanel> <o

WPF: ComboBox with selecteditem set make not use of SelectedIndex=0?

淺唱寂寞╮ 提交于 2019-12-11 07:53:00
问题 Why is the first element in my combobox popup menu not shown in the selected item area of my combobox , when I use the SelectedItem binding? Without that it is showing up ?? Using the same code selecteditem + selectedindex that is no problem! <ComboBox ItemsSource="{Binding SchoolclassSubjectViewModels}" SelectedItem="{Binding SelectedSchoolclassSubjectViewModel}" SelectedIndex="0" Height="23" HorizontalAlignment="Left" Margin="375,13,0,0" VerticalAlignment="Top" Width="151"> <ComboBox

How to get selected value from DropDownList which is inside GridView

拟墨画扇 提交于 2019-12-08 11:18:50
问题 I have a DropDownList inside GridView. There can be ' n ' number of rows in a GridView with each row having a DropDownList with different values. I am populating DropDownLists dynamically and all the values are populated properly in DropDownLists. When I change the selected value of DropDownList for each row and press the button to save these values, I always get the value of 0 index instead of the value that I have selected. I found lot of questions like this but none of them helps me. What

Delete Selected File from Listbox and Folder

点点圈 提交于 2019-12-08 05:33:42
问题 I want to Delete the Selected File from Listbox and Folder. For now it's only removing it from the Listbox. Now I want it to be removed also from the Folder. Thanks private void tDeletebtn_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) listBox1.Items.RemoveAt(listBox1.SelectedIndex); } private void TeacherForm_Load(object sender, EventArgs e) { DirectoryInfo dinfo = new DirectoryInfo(@"data\\Teachers\\"); FileInfo[] Files = dinfo.GetFiles("*.xml"); foreach (FileInfo