html-select

KnockoutJS: How to add one observableArray to another?

岁酱吖の 提交于 2019-12-06 12:07:36
问题 I want to add selected options from select element to binding table. The view model has addItem function that add selectedItems array into addedItems array with using ko.utils.arrayPushAll(). But nothing happens when I click on Add button (calls addItem function). How to correctly add one observable array to another? HTML <label>Parameter list</label> <br/> <select multiple="multiple" data-bind="options: items, selectedOptions: selectedItems, optionsText: 'name', optionsValue: 'id'"> </select

Set an option to be displayed at first position using jQuery

拈花ヽ惹草 提交于 2019-12-06 07:39:11
I have a select element with some options: <select id="choose"> <option id="first" value='null'>choose</option> <option id="g1" value='1'>gate1</option> <option id="g2" value='2'>gate2</option> </select> The user selects an option and submits the form. The data is stored. Anytime the user comes back I want the previously saved option to be display at the top of the select element, instead of choose. I do it e.g. this way $("#choose").val("2"); It just highlights the option in the list, but choose is still the first element. How do I accomplish that? Sounds like you want to move the selected

rails 4 — concatenate fields in collection_select

痞子三分冷 提交于 2019-12-06 06:57:56
I'm working on learning Rails 4 via several tutorials, and building a demo app. I have a table called players that links to a team table. The team has many players, a player has only one team. So I'm using a collection_select tag to pull the team data into the player form. It looks like this: <%= collection_select :player, :team_id, Team.find(:all), :id, :name, options ={:prompt => "Select a team"} %> This works fine-- but I'd like to have the format look like "Team Name: Team City"-- I can't figure out how to concatenate the :name and :city values in the tag however. Is this possible? Create

Drop Down List Issue

北城余情 提交于 2019-12-06 05:33:03
问题 I’m having an issue where a drop down list in IE 6/7 is behaving as such: You can see that the drop down width is not wide enough to display the whole text without expanding the overall drop down list. However in Firefox, there is no issue as it expands the width accordingly. This is the behaviour we want in IE 6/7: We’ve looked at various ways to utilize the onfocus, onblur, onchange, keyboard and mouse events to attempt to solve the problem but still some issues. I was wondering if anyone

HTML <select>: focus option based on user input?

巧了我就是萌 提交于 2019-12-06 05:13:42
问题 I have an HTML select element: <select id='poetslist'> <option value="shakespeare">William Shakespeare</option> <option value="milton">John Milton</option> <option value="keats">John Keats</option> <option value="wordsworth">William Wordsworth</option> <option value="larkin">Phillip Larkin</option> </select> In Chrome, when the page loads, the William Shakespeare option is selected. If the user starts typing 'Phil', the list focusses itself on Phillip Larkin . Familiar behaviour. What I'd

Angular set dropdown select option as default selected before iteration

依然范特西╮ 提交于 2019-12-06 05:09:30
I have a select dropdown and I iterate the options from a list. I am trying to set as selected a separate option (as a default), in case of user is not selecting a value. Here is how I am trying to implement that: <select [(ngModel)]="book.pageLayout"> <option [value]="0" [attr.selected]="book.defaultLayoutId === null">No Default Layout</option> <option *ngFor="let l of availableLayouts" [value]="l.id" [attr.selected]="book.pageLayout == l.id"> {{l?.name}} </option> </select> I also tried: <option [value]="0" selected="selected">No Default Layout</option> and even: <option [value]="0" selected

Multiple select box is not working in rails

会有一股神秘感。 提交于 2019-12-06 04:45:15
I am using the following code to select multiple values. <select name="video" multiple="multiple" id="form-field-select-2" class="form-control"> <%video.each do |option|%> <option><%=option%> </option> <%end%> </select> But after submitting form its not giving all selected values,instead of its giving only the last selected value. Please share if you have any idea about this issue. <select name="video[]" multiple="multiple" id="form-field-select-2" class="form-control"> <%video.each do |option|%> <option><%=option%> </option> <%end%> </select> You need to make sure that you are sending an

HTML <select> control disabled in Android WebView (in emulator)

浪子不回头ぞ 提交于 2019-12-06 03:02:29
问题 I have a very simple Android app that's just a WebView. Everything works fine (complex Javascript etc.). However, all of the HTML select controls seem to be disabled. They display with default values, but nothing happens when I click on them, and they don't get the orange highlight when I arrow through the controls. Other inputs (text, radios, submit) work fine, so I don't think it's a focus issue. Configuration: Eclipse IDE SDK Version 8 (2.2) Testing in the Emulator 回答1: I had the same

How to post the selections of an HTML List Box with multiple selected values

寵の児 提交于 2019-12-06 02:06:30
问题 I have a listbox on an HTML form with a Submit button. The listbox has multiple selection enabled. I am able to select multiple values in the listbox, but I don't know how to figure out what values were selected when the form is submitted. Also, I am adding user generated values to the list box dynamically using JavaScript, and I would like to be able to tell two things when the form submits: What are the options added to the box by the user? What values are selected in the box by the user?

Is using a select list for navigation SEO Friendly?

爷,独闯天下 提交于 2019-12-06 00:11:55
问题 I really don't like the use of select/option elements for links: But they've found their way into the designers portfolio as an option and try as I might to dissuade them from using them, I know I'm going to lose the battle without the power Google and "it's bad for SEO". I searched all over the net, and can find nothing specific to support or debunk my thoughts. The select list that I write will end up having full accessibility with a back end script to follow the link, but does anyone know