Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Make an element in a multiple list unselectable???

Reply
Thread Tools

Make an element in a multiple list unselectable???

 
 
Nick
Guest
Posts: n/a
 
      07-21-2003
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
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      07-21-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (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 <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-22-2003
Steve Pugh <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
Can be multiple instances of element used as the root element? VK XML 8 10-31-2006 06:51 PM
Creating a list of multiple element rows, and sorting them. Daz C++ 2 07-02-2006 11:07 PM
searching a list of dictionaries for an element in a list. Odd-R. Python 2 08-10-2005 01:13 PM
schema unordered element list with any element CJ XML 0 12-17-2003 07:48 PM



Advertisments