Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:38:35+00:00 2026-06-09T00:38:35+00:00

I have a really annoying bug thats outlined here: <select> only shows first char

  • 0

I have a really annoying bug thats outlined here: <select> only shows first char of selected option and I need a way to remove the display:none off of my boxes to avoid this bug. Any suggestions?

Heres the binding:

<select data-bind="options: Values, optionsText: 'DisplayNameWithCost', optionsCaption: ControlCaption, selectedOptions: SelectedValues, event: { change: $root.resolveAllAttributeUi }, disable: IsDisabled"></select>

EDIT:
I’ve managed to figure out that its because selectedOptions: SelectedValues is blank and it’s not selecting anything in IE9.. As for the fix I’m not sure. Here’s an example try in IE9 http://jsfiddle.net/9CaTa/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:38:36+00:00Added an answer on June 9, 2026 at 12:38 am

    selectedOptions is only meant to be used with a multi-select list. See http://knockoutjs.com/documentation/selectedOptions-binding.html.

    You probably want to use the value binding instead: http://jsfiddle.net/mbest/9CaTa/2/

    Edit:

    selectedOptions doesn’t work well with optionsCaption, but you could make it at least select the first item by default by creating a custom binding that wraps selectedOptions:

    ko.bindingHandlers.mySelectedOptions = ko.utils.extend({}, ko.bindingHandlers.selectedOptions);
    ko.bindingHandlers.mySelectedOptions.update = function(element) {
        ko.bindingHandlers.selectedOptions.update.apply(this, arguments);
        if (element.selectedIndex === -1)
            element.selectedIndex = 0;
    }
    

    Here’s your example using this binding: http://jsfiddle.net/mbest/9CaTa/3/

    I noticed that if I select the caption, the selected array will not be cleared. Instead it will have a single undefined item. If you didn’t want that, you could check for it in your custom update function as well and then clear the array: http://jsfiddle.net/mbest/9CaTa/4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I have a really annoying IE7 bug that I am trying to work
Ok this is a really annoying bug that I have been having issues with
I have come across what seems like a really annoying bug running my C++
This is getting really annoying for me. I only have this line for my
I am stuck with something quite simple but really annoying: I have an xml
Hey guys, I have another really annoying problem in IE. I am using a
This is really annoying me as I have done it before, about a year
I have an error on my Android Application and one of the really annoying
I do experience a really annoying problem with TestNG and RESTeasy. I do have
I have encountered an annoying bug with internet explorer on a javascript animation I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.