Listbox-like functionality with formatting

C

Chris

I'd like to put a control on the screen that works like a listbox, where
the user can select different rows by pressing the up or down arrows,
but also have some formatting.

It would be nice to have two lines per item, and include formatting
options inside each item like bold, fonts, color, etc.

I see no way to do that with a traditional listbox. Is there any way to
do it with .css alone?

I'd really hate to have to write a ton of javascript to get this
functionality.
 
A

Adrienne Boswell

I'd like to put a control on the screen that works like a listbox, where
the user can select different rows by pressing the up or down arrows,
but also have some formatting.

It would be nice to have two lines per item, and include formatting
options inside each item like bold, fonts, color, etc.

I see no way to do that with a traditional listbox. Is there any way to
do it with .css alone?

I'd really hate to have to write a ton of javascript to get this
functionality.

I would hate for you to have to write a lot of javascript, too.

You might want to try something like:
<select name="field">
<optgroup label="category1">
<option value="value1">Value 1</option>
<option value="value2">Value 2</option>
</optgroup>
<optgroup label="category2">
<option value="value3">Value 3</option>
<option value="value4">Value 4</option>
</optgroup>
</select>

You can play around with the CSS, but understand that browser support is
iffy at best.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top