Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

size of a select box? 1

Status
Not open for further replies.

WannaLearn

Programmer
Jul 10, 2001
210
US
Is it possiable to define the size of a drop-down combo box? I need to have all the select boxes to be the same size, regardless of the infor entered.
Example:
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>
<p>
<select name=&quot;select&quot;>
<option>one</option>
<option>fasfasfasfas</option>
<option>sfasfasf</option>
<option>asdfasfa</option>
<option>sf</option>
<option>sdfas</option>
<option>sfa</option>
<option>sdf</option>
<option>asfsa</option>
</select>
</p>
<p>
<select name=&quot;select2&quot;>
<option>fdsfgsd</option>
<option>dfg</option>
<option>dg</option>
<option>sdfg</option>
<option>sdfg</option>
<option>dg</option>
</select>
</p>
<p>
<select name=&quot;select3&quot;>
<option>fghf</option>
<option>fghd</option>
<option>fghf</option>
<option>fghdf</option>
<option>fh</option>
<option>dfgh</option>
<option>fh</option>
</select>
</p>
</form>
 
Yes in IE you can:

<select name=&quot;select2&quot; style=&quot;width:200px&quot;>

Hope this helps,
Erik

 
Hi, it works great in IE, but what I can do for Netscape?
 
i thought you could just use the size property...

<select name=&quot;select2&quot; size=&quot;10&quot;>

I hope this helps,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
 
Nope, that turns the drop-down into a multi-value list.
 
As Boomerang said give it some &quot;style&quot; as well as width give it a font-family and font-size. This'll make it look sweet in IE. For NS drop in another option as below:

<option value=&quot;&quot;>- - - - - - - - - - - - </option>

Play around to get desired width, looks OK when drop down is opened and gives the form a nice EVEN look in NS.

Dirty but it works.
 
i know its not exactly the answer to your question but a way of getting IE and NS to have the same size input boxes is to specify a fixed width font eg. 'courier new'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top