Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled/Selected first option will not show #234

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

Disabled/Selected first option will not show #234

ryanshrum opened this issue May 30, 2012 · 7 comments

Comments

@ryanshrum
Copy link

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
Copy link
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
Copy link
Owner

fnagel commented Jun 26, 2012

Any feedback on this issue?

@ryanshrum
Copy link
Author

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.

@abloore
Copy link

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
Copy link
Owner

fnagel commented Jul 20, 2012

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

@abloore
Copy link

abloore commented Jul 20, 2012

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

@fnagel
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants