Forum Moderators: open
Is it possible to make words in an option wrap so the option is on two lines? Like the second option of these three:
- This is a short option
- This is a very long option
with several words
- This is a short option
Now the good news (sort of.) I have seen a complex js workaround that involved multiple select and some script that made both lines select when one was clicked - but I can't find the details right now and my memory may be rusty - it was a long time ago.
But I'm pretty sure someone wrote up a work-around somewhere. Right now Google is not giving it to me however.
Actually, the JavaScript can be fairly simple. Here's what I'm going to do:
- I'll have two <option> tags, both with the same value attribute, with half the text in each (I'll give the second one a couple of non-breaking spaces to make it indent).
- When either is selected, I'll use JavaScript to just select the first one: after all, the select box (in it's "closed" position, which it will be after the click) only shows one line and it's appropriate for that line to be the first one. If anyone has JavaScript disabled it won't really matter because they'll still have the line they selected highlighted and the form will still work correctly.
:)