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

option to use 'title' of selected items when 'data-content' is used #620

Closed
seanbotha123 opened this issue Jun 12, 2014 · 3 comments
Closed

Comments

@seanbotha123
Copy link

Hi thanks for the great plugin.

My issue:
I am using the 'data-content' to display html, which includes images, in my dropdown which should be able to handle multiple selection. this all works really well. but when I select options they display the whole html content; It looks to me like the data-content overrides the title? i would just want to display the title instead of the data-content html. Any way to do this?

code:

untitled

this currently displays the image, but this image is too large and does not even fit inside the input. So basically just want to display the title like: Option1, Option 3.

Oh I also can't seem to get the values of items selected. only returns the first item. I am using:
var value = document.getElementById('ddl').value; . Not sure if I am missing something?

Thanks!

@t0xicCode
Copy link
Collaborator

Could you link us a jsfiddle or a demo of the issue? It would help us comprehend and fix the problem.

To get the value of the selectpicker, use the val method:

var value = $('.selectpicker').selectpicker('val');

@ThCC
Copy link

ThCC commented Nov 18, 2014

I have the same problem.
What is established in the "data-content" will be the contents to be displayed on the button.

@mbabker
Copy link

mbabker commented Dec 28, 2014

A jsfiddle isn't actually needed to show this issue. Right on the demo page for the data-content attribute, you can see the HTML displayed when you hover over the selector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants