selected

How to keep a specific value selected in a select HTML control in following scenario?

耗尽温柔 提交于 2019-12-13 06:19:29
问题 I'm using PHP, Smarty and MySQL for my website. I'm having a select control. The code for it is as follows: <select name="contact_label" id="set_contact_label"> <option value=""> -- Select label-- </option> {if $enquiries_labels} {foreach from=$enquiries_labels item=label key=key} <option value="{$key}" {if $contact_label == $key} selected="selected" {/if}>{$label}</option> {/foreach} {/if} </select> Equivalent HTML output is as follows: <select name="contact_label" id="contact_label">

Keeping selected an option in select dropdown with jquery after refresh

隐身守侯 提交于 2019-12-13 05:33:10
问题 I have small script that reloads a select containing the nicknames of the users in a chatroom. When someone clicks the select, the javascript refreshes it, repopulating the option from a php page to add people that have logged in and removing those who logged out. The script works properly on reloading the select, but I want it to avoid losing the precedent selected option if a user clicks the select another time to refresh the list, and the script doesn't keep the correct option. All the

Populate item to dropdown by using ajax call and assign selected value

淺唱寂寞╮ 提交于 2019-12-13 04:33:38
问题 Please see my code below $(document).ready(function () { readddl().done(function () { $('#ddlAreas').val("51"); }); $("#plusBtn").bind("vclick", function () { $('#ddlAreas').val("51"); }); }); function readddl() { var df = $.Deferred(); var stateID = 18; var dropdwonlist = $('#ddlAreas'); dropdwonlist.empty(); dropdwonlist.append($('<option></option>').val("--").html("Select Area")); if (stateID != undefined && stateID != "--") { // Send an AJAX request $.getJSON(Config.Url + "Area?status=A&

IsSelected property of ViewModel bound to ListBox, Only FIRST item selection works?

本小妞迷上赌 提交于 2019-12-13 03:11:18
问题 I have a MeetingViewModelList bound to a DataGrid . Each MeetingViewModel has a DocumentViewModelList bound to a ListBox within the DataGrid`s DataGridTemplateColumn . The IsSelected property of the DocumentViewModel is bound to the ListBox`s Item property IsSelected. I get no binding errors in the output console. The delete document button in the DocumentViewModel checks in its CanExecute Method this: private bool CanDeleteDocument() { return _isSelected; } When I select the FIRST Item in

Selected Entry in a Drop Down Select HTML Form Element

一个人想着一个人 提交于 2019-12-13 02:51:40
问题 This drop down list, displaying all the files from a folder, one of which will be selected for use. Is there a way to show which file is selected when you load the page? At the moment it says "select a file" every time. <select name="image" type="text" class="box" id="image" value="<?=$image;?>"> <option value='empty'>Select a file</option> <?php $dirname = "images/"; $images = scandir($dirname); // This is how you sort an array, see http://php.net/sort natsort($images); // There's no need to

How can I speed up jquery :selected selector?

匆匆过客 提交于 2019-12-12 16:02:39
问题 I have a dropdown in a web page with 3830 elements in it. I know, excessive but whatever. In jquery I get the selected option value using the statement: $( "#institutionCombo :selected" ).val(); There is a noticeable pause before the selection is found. Once I get that value I insert it into a textbox on the page, so I know how fast. Plus I've checked it using breakpoints in Firebug. If I go old school and use this javascript: var div = document.getElementById( "maindiv" ); var select = div

Spinner with custom ArrayAdapter for objects not displaying selected item

假如想象 提交于 2019-12-12 10:54:55
问题 I have a custom ArrayAdapter to represent objects on a spinner control, I can load my items list and show it for selection, but when the actual selection happens the spinner shows nothing. Activity code: public MetroData metroData; private Spinner spinner; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); metroData = new MetroData(); spinner = (Spinner) findViewById(R.id.spinner1); StopArrayAdapter dAdapter = new

Updating DataGridView Selected Rows

假装没事ソ 提交于 2019-12-12 10:29:21
问题 I tried to update selected rows in DataGridView, but the result is strange, it always missing a row or another. The problem is when I click btnSettled button to set the settled date, then click btnUpdate to update the database, the result seems ok, but after click btnRefresh to refresh the DGV, there is always a missing row. Is that the problem on UpdateCommand or foreach loop? Please help me to solve this problem. Thank you. before click btnSettle after click btnSettled and btnUpdate after

Xcode: set image on button only for default state, not also selected

◇◆丶佛笑我妖孽 提交于 2019-12-12 09:39:47
问题 I am new to Xcode and iPhone programming in general.. I have a simple problem thats bugging me.. I want to set an image on a button, for it's default state. So I select the button, and in the "Show the attributes inspector"-tab, I select "state config" to be default, then I find the desired image in "image"-drop down list... Problem: I change the "state config" to selected, and the image is still on. I need the image to only be on in default state. I have same problem if i want different font

UIButton Highlighted State not showing when clicking over a Selected UIButton

放肆的年华 提交于 2019-12-12 08:34:40
问题 I want my UIButton to show up the highlighted state when I click over a button that is already selected. Basically in the highlighted state I apply a *.png image as my UIButton backgroundImage to give a pressed down effect. But if the button is already in the Selected State When I click over it again I just can't see the highlighted state but it goes straight to the normal state! Watch the Issue--> Video of the Issue! Help please //0 init UIButton UIButton *button = [[UIButton alloc]