Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: howto create a select box with a fixed width but dynamic data??


Message #1 by "flummi" <flummi@e...> on Wed, 29 May 2002 08:56:19
Hello,

to have a good user interface, i want to create select boxes with a fixed 
width but with dynamic data. The problem is, that the <select> tag does 
not have a width attribut and the width is determined by the longest 
entry. Since I want the data for the options of the <select> tag to be 
dynamic, the length of the select box will also be dynamic, right?

Can anybody help me? How can I achieve that the lenght is fixed?

Thanx for any help :-)
Message #2 by olgat@c... on Wed, 29 May 2002 10:56:41 +0200
it has a size parameter , use it
SIZE=n  Specifies the size of the control. 

-----Original Message-----
From: flummi [mailto:flummi@e...]
Sent: Wednesday, May 29, 2002 10:56 AM
To: ASP Web HowTo
Subject: [asp_web_howto] howto create a select box with a fixed width
but dynamic data??


Hello,

to have a good user interface, i want to create select boxes with a fixed 
width but with dynamic data. The problem is, that the <select> tag does 
not have a width attribut and the width is determined by the longest 
entry. Since I want the data for the options of the <select> tag to be 
dynamic, the length of the select box will also be dynamic, right?

Can anybody help me? How can I achieve that the lenght is fixed?

Thanx for any help :-)

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #3 by "flummi" <flummi@e...> on Wed, 29 May 2002 09:37:35
Well that doesn't solve the problem...
The size parameter is for the number of entries, so it defines the heigth 
of the select. But I need to define the width (or do I have to say 
lenght? - I mean the size from left to right :-)). 
Thanx anyway for trying to help ;-)


> it has a size parameter , use it
SIZE=n  Specifies the size of the control. 

-----Original Message-----
From: flummi [mailto:flummi@e...]
Sent: Wednesday, May 29, 2002 10:56 AM
To: ASP Web HowTo
Subject: [asp_web_howto] howto create a select box with a fixed width
but dynamic data??


Hello,

to have a good user interface, i want to create select boxes with a fixed 
width but with dynamic data. The problem is, that the <select> tag does 
not have a width attribut and the width is determined by the longest 
entry. Since I want the data for the options of the <select> tag to be 
dynamic, the length of the select box will also be dynamic, right?

Can anybody help me? How can I achieve that the lenght is fixed?

Thanx for any help :-)

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #4 by "phil griffiths" <pgtips@m...> on Wed, 29 May 2002 09:52:49
The <select> may not have a width attribute but you can use the CSS width 
style for browsers that support this, e.g.
<select name="lstLinks" id="lstLinks" size="5" style="position: absolute; 
left: 285px; top: 345px; width: 290px;" multiple></select>

HTH
Phil
> Hello,

> to have a good user interface, i want to create select boxes with a 
fixed 
w> idth but with dynamic data. The problem is, that the <select> tag does 
n> ot have a width attribut and the width is determined by the longest 
e> ntry. Since I want the data for the options of the <select> tag to be 
d> ynamic, the length of the select box will also be dynamic, right?

> Can anybody help me? How can I achieve that the lenght is fixed?

> Thanx for any help :-)
Message #5 by "Alex Shiell, ITS, EB, SE" <alex.shiell@s...> on Wed, 29 May 2002 09:45:11 +0100
Just use CSS

<SELECT STYLE="width:200px">

-----Original Message-----
From: flummi [mailto:flummi@e...]
Sent: 29 May 2002 10:38
To: ASP Web HowTo
Subject: [asp_web_howto] RE: howto create a select box with a fixed
width but dynamic data??


Well that doesn't solve the problem...
The size parameter is for the number of entries, so it defines the heigth 
of the select. But I need to define the width (or do I have to say 
lenght? - I mean the size from left to right :-)). 
Thanx anyway for trying to help ;-)


> it has a size parameter , use it
SIZE=n  Specifies the size of the control. 

-----Original Message-----
From: flummi [mailto:flummi@e...]
Sent: Wednesday, May 29, 2002 10:56 AM
To: ASP Web HowTo
Subject: [asp_web_howto] howto create a select box with a fixed width
but dynamic data??


Hello,

to have a good user interface, i want to create select boxes with a fixed 
width but with dynamic data. The problem is, that the <select> tag does 
not have a width attribut and the width is determined by the longest 
entry. Since I want the data for the options of the <select> tag to be 
dynamic, the length of the select box will also be dynamic, right?

Can anybody help me? How can I achieve that the lenght is fixed?

Thanx for any help :-)

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com

Headquarters Address & Contact Numbers

150 Broomielaw
5 Atlantic Quay
Glasgow
G2 8LU.
Tel:  +44 (0) 141 248 2700.
Fax:  +44 (0)141 221 3217

 This message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.


Message #6 by "flummi" <flummi@e...> on Wed, 29 May 2002 10:44:39
Thanx a lot, this works :-))

> Just use CSS

<SELECT STYLE="width:200px">


  Return to Index