Select box with checkboxes

Wonder if you guys can help me?

I want a dropdown box (easy), BUT, I want the content of the drop down box to be a series of checkboxes. I know it can be done in pure XHTML, but a combination of HTML/Javascript/DOM should work ... I think?

Also note, that when the user clicks on the dropdown list, the z-indez of that IFRAME or layer (what ever you use) must be on top of any other control. And, when a user checks on any of the control, and clicks anywhere on the body of the HTML form, the select box should have the values of the checkbox. And when the user clicks on the select box it should check the values the user has checked.

Hope I've made sense?

I know it sounds compliciated, I sure cant do it. Please let me know if its possible?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

not possible 'cause the option tag my not contain any other tags, just #PCDATA
mousemat24Author Commented:
How about something that "looks" like a select box, but when you click on it, it opens up as a "like" a select box with checkboxs?
well you can write a javascript function which is called when you select something from your pulldown, and then creates a checkbox in the DOM which itself shows your pulldown again with onmouseover event.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

or use something like:

  <input type=checkbox ... id="check1" style="display:none" />
  <select name=pulldown >

where you set the chekbox to display:visible ifyou have selected it.
mousemat24Author Commented:

|                  |V|
|                      |
| [X]  test         |
| [X]  testing     |
| [X]  paper      |
| [  ]  pen         |
| [  ]  color       |

The bove is the kind of thing I want, a so called list box with check boxes
As I said: not possible with option tag. Dot. Period.
Did you try my suggestion with the invisible checkbox, which gets displayedon change?

something like:
  <select name=pulldown onchange="document.getElementById('check1').style.display='visible'">

Note that you need to hide all others, and hilight only the one depending on your selection.
can this be an option for you :)

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mousemat24Author Commented:
Thanks iscode

Thats kinda what I was looking for.
Your welcome mousemat24

Glad I could help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.