View Full Version : Form element (list) problem.
 
 RickJ
Dec 6, 2005, 10:30 AM
I'm using
 
 
style="width:200px" in the select tag to control the width of list boxes, but I'm missing the horizontal scroll bar:
 
See the Construction list at http://ohiobusinesslist.com/query2.html
 
How can I get a horizontal scroll bar for the lists that have items in them that are wider than the listbox?
 
Thanks!
 LTheobald
Dec 7, 2005, 02:01 AM
I don't think it's possible with plain HTML/CSS Rick.  It should be possible with some JavaScript and a little DHTML but it's probably not worth it.
 
It'll probably just be best to shrink the font size of the select boxes a little.
 RickJ
Dec 7, 2005, 02:59 AM
Thanks Lee.  Yes, after trying a variety of things that just don't cut the mustard, including a tooltip for long ones (which looks cheezy), I'll just take the font down, and go through all of them looking for any long names - and shorten them.
 RickJ
Dec 7, 2005, 04:20 AM
Aargh!
 
Figured changing the font size would be easy, but I'm not seeing how to do it.
 
Here's a sample of the code of one of the lists:
 
 
<select name="health" size="5" multiple id="select5" style="width:205px">
                                <option>Veterinary 
                                <option>Hospital 
                                <option>Nursing Home 
                                <option>Physicians 
                                <option>Retirement Center 
                                <option>Retirement Living 
                                <option>Retirement Center Food Svc. 
                              </select>
 
I'm using DW... and am guessing that the font size is a default.  Can I insert some code to designate the size of the font of the items in the list?
 
Thank you!
 LTheobald
Dec 7, 2005, 04:52 AM
Yep, that's no problem.  Just add font-width to your style attribute on your select tag.  E.g:
 
 
<select name="health" size="5" multiple id="select5" style="width:205px; font-size: 8pt;">
 RickJ
Dec 7, 2005, 04:56 AM
You deserve double Approval for bearing with me, such a newbie! 
 
Thanks Lee! http://www.jackson8.com/images/amhd/thumb.gif
 RickJ
Dec 7, 2005, 05:06 AM
Double dog-gonnit!
 
Check out these 3 lists: http://www.ohiobusinesslist.com/testlist.html
 
I've got the first designated as size 4, 2nd one 6 and 3rd one 8... yet they all look the same in IE.
 
Any suggestions?
 
How much do I owe you?  :o
 
PS Edit:  Note: they look the same as they did without the font-size designations.
 RickJ
Dec 7, 2005, 05:45 AM
I figured it out.
 
I was missing the ; after the width.