html-select

Firefox not refreshing select tag on page refresh

佐手、 提交于 2019-11-28 01:18:32
I've run into a problem where I have a select tag that the user would use to select a brand of phone and the page using jquery would then just display those phones. Thanks to the help of the people on stack overflow this now works great on every browser but firefox. For some reason when I refresh the page the select tag shows the last selected option but the page shows all phones available as designed. Does anyone have any suggestions or advice on getting firefox to refresh the select tag? I can't show it on js.fiddle because it doesn't happen there so here is a link: http://davidarabis.com

Close a SELECT dropdown list programmatically with Javascript/jQuery

喜欢而已 提交于 2019-11-28 00:38:46
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 server and when returns, the new values are added to the control. The problem is that the control remains open while updating, and I would like to close it. This is an example: http://jsfiddle.net/vtortola/CGuBk/2/ The example's AJAX does not get data probably because something wrong I am doing when calling the jsfiddle api, but it shows how the SELECT remains open during update. I want to know how to

Events IE11 on change

为君一笑 提交于 2019-11-27 23:02:02
问题 My code launches an IE 11 page, clicks on a link and then attempts to fill in two dropdown lists. The first one is filled in successfully with the value "2012" . But the second doesn't get filled in with the value "TOYOTA" . Despite the fact that the second dropdown list no longer shows the command "select", it just doesn't show "TOYOTA" . In other words, it goes from the command "select" to a blank. Whereas the first dropdown correctly goes from the command "select" to "2012" . I thought it

Angular 2: How to get the selected value from different options of a form?

烂漫一生 提交于 2019-11-27 22:13:53
问题 I would like to use a <select> in a form to let the user being able to update values among different <option> . I have used the technique from the guide here: https://angular.io/docs/ts/latest/guide/forms.html. Here is the sample I am talking about: <div class="form-group"> <label for="type">Type :</label> <select class="form-control" [(ngModel)]="order.type" ngControl="type"> <option *ngFor="#type of types" [value]="type">{{type}}</option> </select> </div> In my order-details.component I

Zend Framework - Set 'selected' value in select box dropdown list

霸气de小男生 提交于 2019-11-27 22:00:41
I am adding a select element to a Zend_Form instance as follows: $user = $form->createElement('select','user')->setLabel('User: ')->setRequired(true); foreach($users as $u) { if($selected == $u->id) { $user->addMultiOption($u->id,$u->firstname.' '.$u->lastname); //*** some way of setting a selected option? selected="selected" } else $user->addMultiOption($u->id,$u->firstname.' '.$u->lastname); } I have been searching the docs but cannot find a simple way of pre-setting an option of the select element to 'selected'. I've just worked out how to do it. You have to use the setValue() method of the

ASP.NET MVC 4 ViewModel with DropDownList data

柔情痞子 提交于 2019-11-27 21:05:34
问题 I'm using @html.EditorFor to render my model in edit mode, and a dropdownlist is not rendered. Here's my ViewModel: public class RiskAutoViewModel { public RiskAutoViewModel() { VehicleMakeList = new SelectList(new List<VehicleMake>() { new VehicleMake() { Id = 1, Name = "Renault" }, new VehicleMake() { Id = 2, Name = "Peugeot" } }); } public int NoClaimsDegree { get; set; } public int VehicleValue { get; set; } public int EngineCapacity { get; set; } public int VehicleMake { get; set; }

Pseudo elements and SELECT tag

岁酱吖の 提交于 2019-11-27 19:15:49
Does the select tag allows to use the :after selector in order to create a pseudo element after it? I've tried on Chrome, Safari and Firefox on Mac and it doesn't seem to work. Here is a compromise that I have used. http://jsfiddle.net/pht9d295/3/ <div class="select-wrapper"> <select> <option>United Kingdom</option> <option>Canada</option> <option>United States</option> </select> </div> And CSS body { background-color: #f6f6f6; padding: 10px; } .select-wrapper { background-color: #FFF; display: inline-block; position: relative; } .select-wrapper:after { content:"\f078"; font-family:

jQuery - disable selected options

拥有回忆 提交于 2019-11-27 18:56:28
Need to disable already selected options in select box using jQuery. I'd like it to grey out like asmselect . Test my example here . //JS $("#theSelect").change(function(){ var value = $("#theSelect option:selected").val(); var theDiv = $(".is" + value); theDiv.slideDown().removeClass("hidden"); }); $("div a.remove").click(function () { $(this).parent().slideUp(function() { $(this).addClass("hidden"); }); }); //HTML <body> <div class="selectContainer"> <select id="theSelect"> <option value="">- Select -</option> <option value="Patient">Patient</option> <option value="Physician">Physician<

How can change width of dropdown list?

落花浮王杯 提交于 2019-11-27 18:41:22
I have a listbox and I want to decrease its width. Here is my code: <select name="wgtmsr" id="wgtmsr" style="width: 50px;"> <option value="kg">Kg</option> <option value="gm">Gm</option> <option value="pound">Pound</option> <option value="MetricTon">Metric ton</option> <option value="litre">Litre</option> <option value="ounce">Ounce</option> </select> This code works on IE 6 but not in Mozilla Firefox (latest version). Can anybody please tell me how I can decrease the width of the dropdown list on Firefox? Try this code: <select name="wgtmsr" id="wgtmsr"> <option value="kg">Kg</option> <option

JavaScript to create a dropdown list and get the selected value

纵饮孤独 提交于 2019-11-27 18:16:30
问题 I need to add a dropdown list to a webpage. generally the HTML code is like this; <select id="au_1_sel" name="au_1_sel" class="searchw8"> <option value="AU" selected="">method1</option> <option value="FI">method2</option> </select> How can I use JavaScript to create a element like above. after I create this drop down list. I need to add it after a button. var button = document.getElementById("button1"); and I already get the button element. Also, when the button is clicked, I want to know