html-select Questions

28

Solved

I have a <select> element with the multiple attribute. How can I get this element's selected values using JavaScript? Here's what I'm trying: function loopSelected() { var txtSelectedVal...
Kickback asked 3/5, 2011 at 7:1

15

Solved

Okay, I have this code: <select name="selector" id="selector"> <option value="1">Option 1</option> <option value="2">Option 2</option> </select> And I'd like ...
Oneil asked 26/10, 2012 at 15:31

31

Solved

How do I get the selected value from a dropdown list using JavaScript? <form> <select id="ddlViewBy"> <option value="1">test1</option> <option value="2" selected="...
Marble asked 6/7, 2009 at 7:25

8

Solved

I have the following jquery function: $.post('GetSalesRepfromCustomer', { data: selectedObj.value }, function (result) { alert(result[0]); $('select[name^="salesrep"]').val(result[0]); }); re...
Swanner asked 25/7, 2013 at 11:18

5

Solved

I have a question about form submit & onchange events not working together. When I change the value on the dropdown list the event viewroom() is not firing. Could anyone help me with this? The ...
Immingle asked 17/2, 2013 at 9:59

8

Solved

I have a drop drown list and I am having trouble checking whether or not a value has been selected from the drop down list Below is my HTML Code : <label class="paylabel" for="cardtype">Car...
Vorticella asked 13/4, 2013 at 11:11

28

Solved

Using core jQuery, how do you remove all the options of a select box, then add one option and select it? My select box is the following. <Select id="mySelect" size="9"> </Select> ED...
Lavellelaven asked 6/9, 2008 at 20:53

5

Solved

I'm trying to follow a design of a select dropdown-list where: Padding: 0 10px 0 10px However, the arrow is not being adjusted at all. It keeps sticking to the right end. Please see attached scre...
Drawbar asked 3/12, 2020 at 6:24

17

Solved

I want to set a option that was selected previously to be displayed on page load. I tried it with the following code: $("#gate").val('Gateway 2'); with <select id="gate"> <option valu...
Branks asked 13/1, 2011 at 12:35

11

Solved

I used e.target.value to retrieve the current selected value from bootstrap-select but it returned the first selected value i.e. the alert kept displaying item 1, when item 1 and item 2 where selec...

3

Solved

Expected behavior: After selecting an item, Menu list will be close immediately and Select component loses its focus state with borderBottom become 1px solid and backgroundColor become white. Cur...
Fleisher asked 21/5, 2019 at 15:26

2

Solved

I have the next selectbox in HTML: <select id="listbox-taskStatus" class="selectpicker"> <option status="0">In progress</option> <option status="1">Not started</option...
Plica asked 21/8, 2014 at 15:44

4

Solved

I have tried the following to try to click an option in a select dropdown none of which work. selectEl = fixture.debugElement.query(By.css('#dropdown')); selectEl.nativeElement.options[3].nativeE...
Syrup asked 23/2, 2018 at 11:58

7

I have hidden form with a few select fields and some input fields. Click on button should show that form and set some values in the fields. The input fields are filled with given values but I have ...
Aguish asked 3/12, 2010 at 9:27

14

Solved

I am using Angular 2 (TypeScript). I want to do something with the new selection, but what I get in onChange() is always the last selection. How can I get the new selection? <select [(ngModel)...
Mental asked 13/11, 2015 at 19:20

12

Solved

I'd like to create a text field with a dropdown list that lets the user choose some predefined values. The user should also be able to type a new value or select a predefined one from a dropdown li...
Pandemic asked 5/11, 2008 at 8:57

6

I want to get text inside the <option> tags as well as its value. Example <select name="make"> <option value="5"> Text </option> </select> I used $_POST['make']; a...
Backstairs asked 20/7, 2011 at 20:0

3

I use nuxt-i18n nuxt-i18n documentation link to get different locales on my website like that : <nuxt-link v-for="locale in $i18n.locales" v-if="locale.code !== $i18n.locale" :key="locale.cod...
Balduin asked 18/7, 2018 at 15:38

9

Solved

I'm working on building new site, and I need a drop down menu to select the amount of something in my site. But at the same time I need this drop down list to accept text. So if the client wants to...
Tophus asked 19/8, 2013 at 8:6

11

Solved

I have a dropdown that is initialized with one single value. When the user clicks it, the single element is removed and a new element is added saying "Loading", then an AJAX call is issued to the s...
Ola asked 1/6, 2012 at 14:12

7

Solved

I tried :include_blank => true, but it didn't work. <select> <%= options_for_select Model.all.collect{|mt| [mt.name, mt.id]} %> </select> If I need to add it to the collect...
Acronym asked 15/7, 2011 at 17:32

18

Solved

I got a select tag with some options in a HTML form: (the data will be collected and processed using PHP) Testing: <select name="Testing"> <option value="1"> One <option value=...
Casa asked 14/7, 2010 at 12:19

3

Solved

Given the HTML: <select id="mySelect"> <option value="1">test1</option> <option value="2">test2</option> <option value="3">test3</option> </select&g...
Tomasz asked 11/8, 2014 at 18:26

14

I want to be able to set the default/selected value of a select element using the JQuery Select2 plugin.
Carree asked 6/6, 2013 at 18:39

3

Solved

I wonder if it's possible in Javascript to get the currently selected options in a <select multiple> field using the Selctors API rather than a "stupid" iteration over all options. select.qu...
Porshaport asked 23/3, 2013 at 12:6

© 2022 - 2024 — McMap. All rights reserved.