Solved

Select box with checkboxes

Posted on 2006-11-18
9
1,196 Views
Last Modified: 2008-02-01
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?
Thanks
Mousemat24
0
Comment
Question by:mousemat24
  • 4
  • 3
  • 2
9 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17972029
not possible 'cause the option tag my not contain any other tags, just #PCDATA
0
 

Author Comment

by:mousemat24
ID: 17972208
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?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17972246
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.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17972271
or use something like:

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

where you set the chekbox to display:visible ifyou have selected it.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:mousemat24
ID: 17972377

 ------------------
|                  |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
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17972517
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.
0
 
LVL 6

Accepted Solution

by:
iscode earned 500 total points
ID: 17976255
can this be an option for you :)
http://c82.net/samples/checklist-basic.html
0
 

Author Comment

by:mousemat24
ID: 17990789
Thanks iscode

Thats kinda what I was looking for.
0
 
LVL 6

Expert Comment

by:iscode
ID: 18004418
Your welcome mousemat24

Glad I could help
iscode
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now