Do you know any opensource JQuery dropdown menu for telephone prefix?

I also needed this, so I built it. Here is a live demo. It currently has the following features: In the country dropdown you can navigate by typing, or using the up/down keys Selecting a country updates the dial code of the entered number Typing a different dial code automatically updates the displayed flag Option … Read more

How to display only the text in datalist HTML5 and not the value?

Edit, updated Following Regent Try (v3) html <input id=”selected” list=”browsers” name=”browser”> <datalist id=”browsers”> <option data-value=”InternetExplorer” value=”1″></option> <option data-value=”Firefox” value=”2″></option> <option data-value=”Chrome” value=”3″></option> <option data-value=”Opera” value=”4″></option> <option data-value=”Safari” value=”5″></option> </datalist> <input id=”submit” type=”submit”> js $(document).ready(function() { var data = {}; $(“#browsers option”).each(function(i,el) { data[$(el).data(“value”)] = $(el).val(); }); // `data` : object of `data-value` : `value` console.log(data, … Read more

Change Text Color of Selected Option in a Select Box

Try this: .greenText{ background-color:green; } .blueText{ background-color:blue; } .redText{ background-color:red; } <select onchange=”this.className=this.options[this.selectedIndex].className” class=”greenText”> <option class=”greenText” value=”apple” >Apple</option> <option class=”redText” value=”banana” >Banana</option> <option class=”blueText” value=”grape” >Grape</option> </select>

Use object array list as spinner adapter

Hi what you need to do is pretty easy, to your class Contact, override the toString() method in it and return the name of the contact. look at the example. it is also available in github public class SpinnerTestOneActivity extends AppCompatActivity { private Spinner spinner; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_spinner_test_one); Toolbar toolbar … Read more

Sorting a DropDownList? – C#, ASP.NET

If you get a DataTable with the data, you can create a DataView off of this and then bind the drop down list to that. Your code would look something like… DataView dvOptions = new DataView(DataTableWithOptions); dvOptions.Sort = “Description”; ddlOptions.DataSource = dvOptions; ddlOptions.DataTextField = “Description”; ddlOptions.DataValueField = “Id”; ddlOptions.DataBind(); Your text field and value field … Read more

use a javascript array to fill up a drop down select box

Use a for loop to iterate through your array. For each string, create a new option element, assign the string as its innerHTML and value, and then append it to the select element. var cuisines = [“Chinese”,”Indian”]; var sel = document.getElementById(‘CuisineList’); for(var i = 0; i < cuisines.length; i++) { var opt = document.createElement(‘option’); opt.innerHTML … Read more

DropDownList AppendDataBoundItems (first item to be blank and no duplicates)

Instead of using AppendDataboundItems=”true” (which will cause the problem you are talking about), respond to the DataBound event for the DropDownList and then add your “blank” item to the top of the list. <asp:DropDownList runat=”server” ID=”MyList” ondatabound=”MyListDataBound”></asp:DropDownList> Then in your code behind: protected void MyListDataBound(object sender, EventArgs e) { MyList.Items.Insert(0, new ListItem(“- Select -“, “”)); … Read more