john wagner
john wagner

Reputation: 811

Select box with 50+ word select

I have a number of subtopics I would like to select using a select / dropdown box. The problem I have is that each subtopic is 30-50 words long. Does anyone know of any way that I can have multi-line selects within a select box? Right now I can show the select but because of my page size I have some data trucated.

I guess maybe jQuery has a solution but not sure as I'm not so familiar with jQuery

Upvotes: 4

Views: 163

Answers (3)

ariel
ariel

Reputation: 16140

You better use autocomplete

To make the dropdown elements multi-line, just edit the css of .ac_results li making it taller (for instance, change line-height)

Upvotes: 2

neurino
neurino

Reputation: 12415

I'd change my mind using something different than a select, rather using a div (or dialog, or accordion) with selectable items in it using jQuery UI.

Upvotes: 0

dartacus
dartacus

Reputation: 644

Instead of using a stock-HTML select element, perhaps consider using a div with n other divs inside it, each with their id as the ID of the subtopic (likely you'll need to prepend something if the Ids are numerical). Show the div on click of whatever, select the subtopic on click of the individual subtopic div. You can then style the divs how you want, allowing text to wrap, etc. This would also work well with an unordered list.

G

Upvotes: 0

Related Questions