ColdFusion dropdown multiple select question

Posted on 2014-01-17
Last Modified: 2014-01-22
When I use the "multiple" option in my cfselect tag in turns my drop down to a list box.

Can I create a regular drop down with little check boxes with ColdFusion?

Please view demo.png.

If not, what technology/software is needed?
Question by:DJPr0
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 25

Accepted Solution

dgrafx earned 250 total points
ID: 39790579
use a jquery plugin
here is a demo:

good luck
LVL 82

Assisted Solution

leakim971 earned 250 total points
ID: 39790701
Test page :

<div id="dropdown1" class="dropdown-container">
	<div class="dropdown_selected"><a href="javascript:void(0)">Choose an option</a></div>
	<div class="dropdown_options">
			<cfloop index="ListElement" list = "John,Paul,George,Ringo"> 
				<cfoutput><li><cfinput type="checkbox" id="cb_#ListElement#" value="#ListElement#" /><label for="cb_#ListElement#">#ListElement#</label></li></cfoutput>

Open in new window

CSS (do your own design) :
.dropdown_options {
.dropdown_selected a {
    text-decoration: none;
.dropdown_options ul {
    width: 108px;
    border-color: red;
    border-width: 1px;
    border-style: solid;
    margin-top: 5px;
.dropdown_options li {

Open in new window

jQuery code :
    jQuery(function($) {
       $(".dropdown_selected").click(function() {
           var options = $(this).next(".dropdown_options");
       $(".dropdown_options :checkbox").change(function() {
           var $selected_checkbox = $(this).closest("ul").find(":checkbox:checked");
           var selected_option = [];
           $selected_checkbox.each(function(i, v) {
               var checkbox_value = $(this).val();
           var $dropdown_selected =  $(this).closest(".dropdown_container").find(".dropdown_selected");
           var list_separator = ",";
           $dropdown_selected.text(selected_option.join(list_separator)||"Choose an option");
       $(document).click(function(evt) {
           var isNotClickInsideDropdown = $(".dropdown_container").length==0;
           var isNotClickOnDropdown = !$(".dropdown_container");
           if(isNotClickInsideDropdown && isNotClickOnDropdown)  {

Open in new window


Author Closing Comment

ID: 39800197

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Validating Date 4 28
Find out all repos that a user is most active on Github 1 28
Echo'd values in dropdowns 6 28
Dynamic Table mySQL stored procedure 5 31
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question