Solved

Select box with checkboxes

Posted on 2006-11-18
9
1,197 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
what is the difference between currentTarget and target 4 34
Split in Javascript 5 31
javascript date picker in php while loop 5 27
how can i count words? 2 18
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now