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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically resize <SELECT> to frame width 1

Status
Not open for further replies.

Niv3k

Programmer
Jul 11, 2001
350
US
I have a page with frames that look like this:
Header
Code:
  |
S | Detail
  |

Where 'S' is the multiline select box, and the lower frames are "33%,*" I want to resize the select box based on how big the frame is, i.e. if the frame ends up being 200 pixels wide by 300 pixels down, I want the select to be 190 pixels wide by 270 down.

Is this possible? Should I repost in another forum? Thanks in advance,
Kevin
 
Hi,
as far as I know, the only way to change the size of a select box is to have longer items in it (i.e. more characters), this is what I was taught anyway.

If this is true then the only way I could see of doing it would be to change the length of one of the options in the select relative to the width of the frame.

Again I believe the height can only be changed by having a bigger font. Of course there could be a method that I haven't seen and if you find it then would you post it here? :)

-Iain X-)
 
hi kevin,

you can change the width and height of a select box using css. try this...

<select style=&quot;width: 90%; height: 90%&quot; size=&quot;3&quot;>
<option>item 1</option>
<option>item 2</option>
<option>item 3</option>
</select>

...for the height, you need to make sure you specify size=&quot;something higher than 1&quot; in order for it to display as a select box, rather than a drop down menu.

ss
 
Well, that works good, but the select box is still ugly inside the frame. So I changed the whole kit-n-kaboodle to a borderless table, and using CSS and javascript, emulated the highlighting of the row. It works good, and looks good, too. Plus, I can add my edit/delete buttons next to each item.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top