473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Make an element in a multiple list unselectable???

Is it possible through css to make an element in a multiple list menu
unselectable. Im organizing my list by using titles...

+-------------+
| CATEGORY 1 |
| option 1 |
| option 2 |
| option 3 |
| CATEGORY 2 |
| option 1 |
| option 2 |
| option 3 |
| CATEGORY 3 |
| option 1 |
| option 2 |
| option 3 |
+-------------+

Id like to make the CATEGORIES unselectable. Thanks! -Nick
Jul 20 '05 #1
2 8922
nb********@hotmail.com (Nick) wrote:
Is it possible through css to make an element in a multiple list menu
unselectable.
I'm presuming that you mean a <select> element rather than just an
ordinary list of links.

Why with CSS? CSS is for presentation. Making something unselectable
sounds like functionality to me.

The disabled attribute exists for the option element. But Windows IE
doesn't support it. :-(
Im organizing my list by using titles...

+-------------+
| CATEGORY 1 |
| option 1 |
| option 2 |
| option 3 |
| CATEGORY 2 |
| option 1 |
| option 2 |
| option 3 |
| CATEGORY 3 |
| option 1 |
| option 2 |
| option 3 |
+-------------+

Id like to make the CATEGORIES unselectable. Thanks! -Nick


Looks like you want the optgroup element.

<select name="foo">
<optgroup label="CATEGORY 1">
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</optgroup>
<optgroup label="CATEGORY 2">
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</optgroup>
<optgroup label="CATEGORY 3">
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</optgroup>
</select>

Works in most modern browsers. In older browsers the options are
presented as normal but the labels aren't presented at all.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
Steve Pugh <st***@pugh.net> wrote:
Looks like you want the optgroup element.
Maybe. But in the absence of a URL to demonstrate what he is really
doing, my verdict is that he wants to create an expensive plastic
simulation of a hierarchic list of links.
Works in most modern browsers. In older browsers the options are
presented as normal but the labels aren't presented at all.


OK, let's say that it works in 95 % of browsing situations (as far as
_rendering_ is considered). The actual figure is probably somewhat
smaller. Anyway, even 5 % of possible users is a huge number. Is it
acceptable that the fallback has no label texts? I would answer:
yes, _if_ the labels are just for grouping options that are
understandable on their own. But it would be disastrous if e.g. some
options were identical, relying on the category labels for
disambiguation.

It's possible to create a hierarchic menu inside a form without using
optgroup, namely by using grouped radio buttons, see
http://www.cs.tut.fi/~jkorpela/forms....html#optgroup

Massive crossposting triggered the usual "set Followup-To at random"
function. In future, the OP should spend some time in analyzing which
is _the group_ for his question.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Kamermans | last post by:
I have an XML document that, in order to save b/w for both server and users, uses a few emtpy tags a la "<add/>" and "<edit/>" in the source, which get javascript replaced once the document is...
2
by: john | last post by:
I'm looking to have a form where a drop down list contains my full range of options even when some are not currently available. Is it possible to produce a select box where some items could show...
2
by: Nick | last post by:
Is it possible through css to make an element in a multiple list menu unselectable. Im organizing my list by using titles... +-------------+ | CATEGORY 1 | | option 1 | | option 2 | | ...
1
by: Mike Kayser | last post by:
Hi, I have a schema which is fine except for one part giving me trouble: (...) <xs:element name="DOC"> <xs:complexType mixed="true"> <xs:sequence> <xs:any processContents="lax"...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
1
by: Garg | last post by:
Hi All, I am facing a technical problem. I have craeated one form and in that I have a table. in that table user can select a row and by using shift key user can select multiple rows. this i did...
15
by: caca | last post by:
Hello, This is a question for the best method (in terms of performance only) to choose a random element from a list among those that satisfy a certain property. This is the setting: I need to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.