Questions tagged [optgroup]

The OPTGROUP element defines a group of choices within a SELECT menu.

The OPTGROUP element defines a group of choices within a SELECT menu. OPTGROUP must contain one or more OPTION elements to define the actual choice

Example:

<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select> 

sources: http://htmlhelp.com/reference/html40/forms/optgroup.html, http://www.w3schools.com/tags/tag_optgroup.asp

259 questions
5
votes
1 answer

preselect multiple values using the selectedOptions knockout binding in an select with optgroup

Ello, I've litteraly tried all the options to making a (multiple) selectbox with optgropus, and binding the options/selectedOptions with knockout. There seems to be an issue with the selectedOptions binding. My data seems to be legit, but it just…
Linksonder
  • 732
  • 2
  • 8
  • 17
5
votes
2 answers

Error using Serge Zab's helper for optgroup dropdowns

I'm trying to work with the optgroup dropdown helper from Serge Zab that can be found here. This is my category table: As you can see I have a category and a category can also be categoryparent from a category. I want to have the parentcategorys as…
nielsv
  • 6,540
  • 35
  • 111
  • 215
5
votes
2 answers

iOS Bug? Unable to change text in a select when focused using jQuery

I am using a select with optgroups for some navigation on mobile devices. I use the optgroup's label to indicate the section it belongs in - and then the option itself to designate the sub-section. The problem is that in pretty much every browser I…
4
votes
2 answers

Populate Select With OptGroup From Two Seperate JSon Objects JQuery

I have two json objects var type = [{"Id":1,"Name":"This is a name"}]; var subType = [{"Id":2,"ParentId":1,"Name":"This is a name"},]; subType.ParentId references the type.Id I want to be able to populate a select in jQuery having ').appendTo('body').append('') .append($('') …
clarkk
  • 27,151
  • 72
  • 200
  • 340
4
votes
3 answers

Convert UL to SELECT w/OPTGROUPs

I'm trying to convert (with jQuery) a multi-level UL into a SELECT dropdown with the nested UL group being wrapped in OPTGROUPSs. I'm messing around with the idea of using this technique to make responsive site menus (think drop-down menus). I've…
Aaron Silber
  • 81
  • 1
  • 2
4
votes
1 answer

Laravel Form dropdown with optgroup

Let's say I have a collection with categories, while eager loading all descriptiones per category. So this means, each category hasMany descriptions. I want to display all descriptions in a dropdown, while the optgroup label is the category name,…
Hardist
  • 2,098
  • 11
  • 49
  • 85
4
votes
2 answers

Get selectize.js to show optgroup headers

I have a .json file containing US city data. I have successfully pulled the data into my selectize select box, but it does not display the optgroup headers. Here is an excerpt of the .json file: [ [...], [{ "Index": 16246, …
Anders
  • 12,088
  • 34
  • 98
  • 146
4
votes
1 answer

Create select with otpgroup based on two different data

Hi Friends here two data in one JSON file where I need to create Select option based on country field and show data based on location field "countries": [ { "id": "75", "country": "France" }, { …
4
votes
1 answer

Check if optgroup by id/label exists in jquery?

I have a dropdown, and in another process add optgroups/options to that dropdown, and that part works fine. But I may need to add similar optgroups, with more data, and I want to check for the existence of that optgroup, and if it exists, don't add…
crosenblum
  • 1,869
  • 5
  • 34
  • 57
4
votes
5 answers

Jquery bootstrap multiselect optgroup selection

I am using Jquery bootstrap multiselect plugin which seems pretty good and fulfill most of the requirements which i needed. The only additional functionality i want is to add checkbox to OptGroup so if user wants to select complete group they can…
d-man
  • 57,473
  • 85
  • 212
  • 296
4
votes
3 answers

Show ComboBox group header for Silverlight

I want to show a ComboBox with OPTGROUP style header gruopings in Silverlight. Every website I find (including questions on SO) that sovle this link to an outdated link and, handily, show no code snippets for me to work from. E.g.: So how do I do…
Chris
  • 26,744
  • 48
  • 193
  • 345
4
votes
2 answers

Jquery, if optgroup does not contain

I need help with the below jQuery, it's not working for me. I want to fire some actions only if does not exist My HTML (which can't be changed):