html-select

CasperJS : dropdown list; select an option, code works in browser&slimer but not with phantom

坚强是说给别人听的谎言 提交于 2019-12-10 15:59:24
问题 Here my problem : I'm in a specific case where I try to set the option of a select dropdown list. I usually use this.mouse.up() + this.mouse.down() but I can't in this case because this behavior doesn't work on the website with webkit (you can compare the two with google chrome and Firefox). Here the url : I want to set the field 'ANNEE' to a year, 2008 in my example My code : (my function changes the HTML and launches the change() event) //custom function casper.fillSelect = function

How to pass <option> attributes to select2?

你说的曾经没有我的故事 提交于 2019-12-10 12:33:06
问题 I'm using Select2 4.0. I have a list of options, some of which are "deleted" and I want to signify which are which. My select element is like this: <style>.deleted { color: red; }</style> <select name="itemid" id="item-list" tabindex="1"> <option></option> <option value="1">Item 1</option> <option value="2" class="deleted">Item 2</option> <option value="3">Item 3</option> </select> And it's initialised like this: <script src="/static/js/select2.min.js"></script> <script> $(function() { $("

Accessibility: Voicerover does not move focus to select element

匆匆过客 提交于 2019-12-10 11:49:22
问题 Following is markup of html <div class="abc1" role="main"> </div> <h1 >header1</h1> <div id="main" role="main" class="main-content"> <div> <div> <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa</p> <p><span class="errortxt"><a>Required fields message</a></span></p> </div> <div id="errorDisp"> <ol> <li id="message-1" aria-hidden="true"> <a></a> </li> <li id="message-2" aria-hidden="true"> <a></a> </li> <li id="message-3" aria-hidden="true"> <a></a> </li> <li

Options added to a <select> are invisible in the list box on iPhone

本小妞迷上赌 提交于 2019-12-10 11:27:27
问题 I have an HTML listbox and I'm adding options using javascript - no problems in any browsers on PC - Mozilla, Chrome, IE, Opera, Safari. However, when performed on iPhone the added option is invisible in the listbox -shows only - (0 items) until you tap on the listbox and then you see the added option as if you were tapping on a regular "select" item, tap on it and only after that the option is visible. I hope I made myself clear enough... The functionality is as follows: user fills text in

php regex to read select form

放肆的年华 提交于 2019-12-10 11:15:24
问题 I have a source file with a select form with some options, like this: <option value="TTO">1031</option><option value="187">187</option><option value="TWO">2SK8</option><option value="411">411</option><option value="AEL">Abec 11</option><option value="ABE">Abec11</option><option value="ACE">Ace</option><option value="ADD">Addikt</option><option value="AFF">Affiliate</option><option value="ALI">Alien Workshop</option><option value="ALG">Alligator</option><option value="ALM">Almost</option> I

Set an option to be displayed at first position using jQuery

怎甘沉沦 提交于 2019-12-10 11:09:30
问题 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

disabled dropdownlist does not keep selected value on postback

情到浓时终转凉″ 提交于 2019-12-10 09:56:11
问题 I'm getting a weird behavior with a dropdownlist when I trigger a postback. If the dropdownlist is enabled, the selected value remains the same after a postback. However, if the dropdownlist is disabled (via a javascript when user ticks a checkbox), then the selected value is reset to the first item in the list. How come ? 回答1: you need to look up the value manually (probably store it in another field or so), and then set it yourself in the code behind. This is because if a control is

Dynamically truncate <option> text to fit <select> list

≡放荡痞女 提交于 2019-12-10 00:05:23
问题 By default, the selector list shown for a <select></select> element will be as wide as the widest <option></option> child it contains. If I hardcode the width of the select tag with CSS to make it more narrow, the widest option is truncated in the display. I want to trim down the option text to fit the selection list, appending ... (ellipsis) to show that it's truncated when the option is selected, however, when I expand the dropdown I want the text in the dropdown to be full width, without

How to update HTML “select” box dynamically in IE

 ̄綄美尐妖づ 提交于 2019-12-09 23:14:12
问题 I've got an HTML "select" element which I'm updating dynamically with code something like this: var selector = document.getElementById('selectorId'); for (var i = 0; i < data.length; ++i) { var opt = document.createElement('option'); opt.value = data[i].id; opt.text = data[i].name; selector.appendChild(opt); } Works fine in Firefox, but IE7 doesn't resize the list box to fit the new data. If the list box is initially empty (which it is in my case), you can hardly see any of the options I've

Simple html select not working on android chrome

旧时模样 提交于 2019-12-09 17:59:09
问题 I'm having trouble with google chrome for android. My select tag in html doesn't work there, but it works on desktop google chrome and other browsers, even in safari and apple mobile devices, just not in google chrome for android. I've tried other apps that have normal selects and they seem to work in mobile google chrome. Here's an example of what's happening: I have no idea how to fix this issue. If anyone could give me hints on what could be the reason. This is the select: <select class=