Skip to content

Disabled/Selected first option will not show #234

Closed
ryanshrum opened this Issue May 30, 2012 · 7 comments

3 participants

@ryanshrum

Is it possible to add a text like "Please choose..." and have it there before click (even after click), make it "disabled". It worked fine until I added the script. Or if there's a callback function I can add the Label value as the first option. Thoughts?

<select>
    <option selected="selected" disabled="disabled">Please choose...</option>
    <option>1</option>
    <option>2</option>
</select>
@fnagel
Owner
fnagel commented May 31, 2012

Mhh this (disbale single options) should be possible without problems. Please take a look at the enabled_disabled.html demo!

@fnagel
Owner
fnagel commented Jun 26, 2012

Any feedback on this issue?

@ryanshrum

Thanks for following up Felix. I should have closed the ticket. I ended up using a different plugin as I needed to offer multi-select as well. Thanks for your prompt support.

@ryanshrum ryanshrum closed this Jun 27, 2012
@abloore
abloore commented Jul 20, 2012

I know this issue has been closed, but I am having the same issue. I know that you are able to disable single options, but it looks like issue that the original reporter is talking about still exists:

If the first option in the HTML select is disabled via the "disabled" attribute AND set to "selected", then the selectmenu widget will not display the selected option as the label.

Example:

<select>
    <option disabled="disabled" selected="selected">Choose one...</option>
    <option>Option 1</option>
    <option>Option 2</option>
    <option>Option 3</option>
</select>

In raw HTML, this will display the select with the text "Choose one..." with that option disabled when it is open, but with the widget initialized, it will display with no label text. This feature is helpful when you want to use the option as a label or instructions for the selectmenu.

@fnagel
Owner
fnagel commented Jul 20, 2012

Now I get the problem. Fixed in latest trunk. Thanks for helping!

@abloore
abloore commented Jul 20, 2012

Thanks! That looks like it works. That was quick!

@fnagel
Owner
fnagel commented Jul 20, 2012

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.