You can use style sheets (e.g. style="width:100px" in the tag), that will
set the width and it will NOT change... in Internet Explorer...
Netscape however is a different story... No matter how you set the width in
Netscape, if any of the contents of the <select> are longer than you expect,
the <select> grows...
One workaround for this is to use JavaScript to add options to the select
after the page has already completely loaded. Since Netscape does not
dynamically resize any of it's elements after a page has loaded, you can
create a page with only a single option in the <select> with a bunch of
spaces ( ) in it to set the width to approximately what you want it to
be. Then, at window.onload, write a event handler function that does the
following:
//Remove the empty buffer option from the <select>
myselect.options[0] = null;
//Insert the options you want in the <select>
myselect.options[myselect.options.length] = new Option("text", "value",
false, false);
on the server-side, you can dynamically create the JavaScript code here,
just as you would dynamically create the HTML content for the options within
the <select> tags...
yuck...
I call this my Super-Duper Netscrape Icky-DOM Hack 13A
:)
Good luck...
Oh... Another option is to scrap the HTML <select> altogether, and write a
little Java applet, that "wraps" a Java list control... and you can write it
to accept the list options as <param>'s inside the <applet> tag.
Scott Costa
[EMAIL PROTECTED]
-----Original Message-----
From: Mukka, Srikanth (GEA, 097902)
[mailto:[EMAIL PROTECTED]]
Sent: Friday, May 12, 2000 8:40 AM
To: [EMAIL PROTECTED]
Subject: Very urgent
Hi All,
Can any one of you tell me how to set the width of the list item.
<Select Name="">
<option value=.....>
</Select>
Is there any way to specify the width for the list item, in my case it is
dynamically changing depending on the strings in the options given in the
tag.
I want it be static, I don't want it to change dynamically as it is
disturbing my interface.
expecting an early reply/
Bye
Srikanth
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets