html-select

KnockoutJS: How to add one observableArray to another?

北城余情 提交于 2019-12-04 15:37:32
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> <p> <button data-bind="click: addItem, enable: selectedItems().length > 0">Add</button> </p> <label

how can i put an image into select? [duplicate]

喜你入骨 提交于 2019-12-04 13:19:21
This question already has answers here : How to add images in select list? (12 answers) Closed 2 years ago . i have this script <select> <option value="1">one<img src="star.gif" height="15" width="15"></img> </option> </select> but it doesn't work. how can i put an image into select? thanks update: so it's impossible?:(maybe via javascript?... you can't - DOM model doesn't allow img elements inside option elements Most website which associate images with a certain option in a menu use JavaScript or jQuery to change an image at the left or right of the menu whenever a new option is selected.

Drop Down List Issue

笑着哭i 提交于 2019-12-04 09:38:50
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 has solved this issue in IE 6/7 without using any toolkits/frameworks (YUI, Ext-JS, jQuery, etc…). This

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

你离开我真会死。 提交于 2019-12-04 09:22:05
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 like to do (preferably using jQuery) is also allow the user to type the initials of the poet and have the

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

落花浮王杯 提交于 2019-12-04 09:11:45
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 I had the same problem. My problem was fixed by changing overflow:hidden to overflow:visible on a containing element. I had the

MVC @Html.DropDownList Getting Error with SelectList in ViewBag

我是研究僧i 提交于 2019-12-04 09:03:52
I have a list which I created in the controller: var PayList = new[] { new ListEntry { Id = 1, Name = "" }, new ListEntry { Id = 2, Name = "Yes" }, new ListEntry { Id = 3, Name = "No" } }; ViewBag.PayList = new SelectList(PayList, "Id", "Name"); In the view I have the following: @Html.DropDownList("Pay", new SelectList(ViewBag.PayList,"Id","Name")) When I try to display it, it says the following: DataBinding: 'System.Web.Mvc.SelectListItem' does not contain a property with the name 'Id'. Not sure why this is not working. Also how do I default a value to the select list. I like to default it to

How to solve the select overlap bug in IE6?

我们两清 提交于 2019-12-04 08:05:19
问题 When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page. I already saw people hiding selects when opening a popup div, that leads to pretty bad user experience having controls disappearing. FogBugz actually had a pretty smart solution (before v6) of turning every select into text boxes when a popup was displayed. This solved the bug and tricked the

Is using a select list for navigation SEO Friendly?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 07:50:54
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 for sure if search engines will follow or ignore the URLs? <form action="/redirect-script" method="post

by jquery, set to option of html-select element selected atribude by text, not value

前提是你 提交于 2019-12-04 06:57:24
I have a select element. <select class='cSelectType'> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> <option value="4">four</option> <option value="5">five</option> </select> i can by jquery set option value selected like this: $('.cSelectType option[value=4]').attr('selected', 'selected'); And select element will show "Four". By i wont something like this: $('.cSelectType option[xxx=Four]').attr('selected', 'selected'); i.e By text set selected attribute. some ideas please. Use the :contains() filter: Description: Select all elements that

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

你离开我真会死。 提交于 2019-12-04 06:38:34
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 this possible? Thanks. Below you find an example of a page. Note that: the select element (and any