Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q858

Feedback on: irt.org FAQ Knowledge Base Q858

Sent by Amos Bannister on September 26, 2000 at 23:02:29: - feedback #1795

Worth:
Worth reading

Length:
Too short

Technical:
Just right

Comments:
Although this was a reasonable answer, it was not technically correct when it stated that it is not possible to limit the width of a select box in Netscape.

To do this you must populate the select box using Javascript. You can specify a WIDTH attribute which will specify the width in pixels (although this is not such a good idea), or you can put one dummy <OPTION> entry which is the width you want. Then you delete the option using Javascript and add all the options you wish to appear in the list. The select box will be forced to stay the size of the original (dummy) entry.

Note: This will not work on IE, so you would need to also include the STYLE specification in the SELECT tag for IE.

--
Amos Bannister



Sent by Jerry Young on November 28, 2001 at 14:32:43: - feedback #3377

Worth:
Worth reading

Comments:
You could also do a mid function on the option text value to reduce the width.


Sent by brendan on April 11, 2002 at 01:14:48: - feedback #3774

Comments:
you can do this in the 6+ browsers using css properties
i.e
<SELECT NAME=\"selectme\" style=\"width:350">


Sent by Rob Freundlich on May 28, 2002 at 14:09:45: - feedback #3910

Worth:
Worth reading

Comments:
The ideas presented here do not work if you are trying to keep the SELECT box a certain size and are dynamically populating the box.

Both IE 5.5 and Netscape 6 will make the SELECT box wide enough for the widest OPTION if you dynamically add OPTIONs.


©2018 Martin Webb