472,958 Members | 1,410 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Dynamic SELECT dropdown box

We have a dropdown combobox, where some of the text is wider than the
textarea.
I cannot set the width of the SELECT any higher due to design
restrictions on the company website.

When clicking the dropdown box, I want the textarea (which unfolds
beneath the dropdown) to expand to the widest element of the options.
I can see that Netscape does this automatically, but how would you do
it in IE?

thanks beforehand
Greg
Jul 20 '05 #1
5 2925
Ganco wrote:
We have a dropdown combobox, where some of the text is wider than
the textarea.
I cannot set the width of the SELECT any higher due to design
restrictions on the company website.
What if CSS is disabled or not even supported? The design is definitely
borken.
When clicking the dropdown box, I want the textarea (which unfolds
beneath the dropdown)
When one writes about a textarea here, it is most certainly considered
a `textarea' (X)HTML element. In this regard, it is not a textarea
that unfolds but a list of options, because it is only displayed as a
dropdown box in *your* UA(s), it is in fact a `select' element of size 1.
to expand to the widest element of the options.
I can see that Netscape does this automatically,
IE (6.0) does it, too, unless you specify the width of the `select'
element with CSS.
but how would you do it in IE?


If you need the fixed width of the element there is no way to accomplish
that. Even if you could do that with JScript[tm] somehow, what if
script support is disabled? Even if you would use an ActiveX control
that allows that rather than the HTML element, what if ActiveX support
is disabled or not present (AFAIK all UAs but IE on Windows)? You
cannot fix design flaws in other ways (including JavaScript) reliably
instead of really *fixing* them.
PointedEars
--
The last words of an *n*x admin:
# fsck /dev/hda8
/dev/hda8 ist already mounted. Destroy directory structure anyway?<y> yes
Please stand by...
Jul 20 '05 #2
Thanks alot for your help sofar, Thomas.

You are right: it is not a textarea, but a list of options which unfolds.

We have CSS enabled, however there are no specific attributes for the SELECT
apart from the one we are inlining (width=110px).

I have tried to take out the 'width' of the SELECT element, however to no
avail. The dropdown just expands to the widest element. This is not allowed
(we have a restriction of max 110px for a dropdown on that specific page).
We want the list of options to expand. Do you possibly have a code snip I
could look at, which does the trick?

We are not allowed to use ActiveX or anything similar, just JScript or
javascript.
When script is disabled, it is not a problem (we use complete different page
renedering logic)
"Thomas 'PointedEars' Lahn" <Po*********@web.de> wrote in message
news:3F**************@PointedEars.de...
Ganco wrote:
We have a dropdown combobox, where some of the text is wider than
the textarea.
I cannot set the width of the SELECT any higher due to design
restrictions on the company website.


What if CSS is disabled or not even supported? The design is definitely
borken.
When clicking the dropdown box, I want the textarea (which unfolds
beneath the dropdown)


When one writes about a textarea here, it is most certainly considered
a `textarea' (X)HTML element. In this regard, it is not a textarea
that unfolds but a list of options, because it is only displayed as a
dropdown box in *your* UA(s), it is in fact a `select' element of size 1.
to expand to the widest element of the options.
I can see that Netscape does this automatically,


IE (6.0) does it, too, unless you specify the width of the `select'
element with CSS.
but how would you do it in IE?


If you need the fixed width of the element there is no way to accomplish
that. Even if you could do that with JScript[tm] somehow, what if
script support is disabled? Even if you would use an ActiveX control
that allows that rather than the HTML element, what if ActiveX support
is disabled or not present (AFAIK all UAs but IE on Windows)? You
cannot fix design flaws in other ways (including JavaScript) reliably
instead of really *fixing* them.
PointedEars
--
The last words of an *n*x admin:
# fsck /dev/hda8
/dev/hda8 ist already mounted. Destroy directory structure anyway?<y> yes
Please stand by...

Jul 20 '05 #3
Gregers A. H. Hovmand wrote:
I have tried to take out the 'width' of the SELECT element, however
to no avail. The dropdown just expands to the widest element. This is
not allowed (we have a restriction of max 110px for a dropdown on
that specific page).
That restriction ignores the basics of the used medium.
We want the list of options to expand. Do you possibly have a code
snip I could look at, which does the trick?
You cannot do that in other ways than I already suggested.
It is the user agent that renders the element, not CSS or
JavaScript. Complain to M$.
[Top post]


Please trim your quotes and place the answer *below* the "question".
PointedEars
Jul 20 '05 #4
> That restriction ignores the basics of the used medium.

Do not understand this statement
You cannot do that in other ways than I already suggested.
It is the user agent that renders the element, not CSS or
JavaScript. Complain to M$.
It is actually the OS which renders this element, not the UA.
Don't understand your suggestion from your last post.
Checked in VB, and it is not possible to do this either.
Maybe one should write code to access the WinAPI to do this? who knows?
Please trim your quotes and place the answer *below* the "question".


OK

Greg
Jul 20 '05 #5
Please include a short attribution line like the below one so one
can see who wrote what you are referring to, even if the posting
expired.

Gregers A. H. Hovmand wrote:

[Quote completed]
Thomas 'PointedEars' Lahn wrote:
Gregers A. H. Hovmand wrote:
[...]
(we have a restriction of max 110px for a dropdown on
that specific page).
That restriction ignores the basics of the used medium.


Do not understand this statement


For one part, (X)HTML is a markup language, not a layout language.
CSS is not a layout language either, but a formatting language
which applies formatting rules to markup elements.

For another, display of a (X)HTML document depends on the client
hardware and its user agent software. Unless you can *guarantee*
that the document is displayed under design conditions, like you
possibly could if it were an intranet document, never ever assume
that the document is rendered that way.
You cannot do that in other ways than I already suggested.
It is the user agent that renders the element, not CSS or
JavaScript. Complain to M$.


It is actually the OS which renders this element, not the UA.


For IE that is most certainly true. For other UAs it is not, which is
part of your problem.
Don't understand your suggestion from your last post.
The suggestion was and is that you forget about it and do a complete
redesign instead because you cannot fix borken design with alternative
approaches reliably.
Checked in VB, and it is not possible to do this either.
Tough luck.
Maybe one should write code to access the WinAPI to do this?


Maybe, but that has nothing to do with JavaScript at all.
PointedEars
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Drew | last post by:
I am trying to build a small app that shows a Course Title from the database, then displays a dropdown full of categories for the user to choose one... I thought a loop would be the best way to...
1
by: russ | last post by:
Hi all, Here's a problem I'm having with a dynamic table. Following the guidelines here (http://www.codeproject.com/aspnet/dynamiccontrols.asp), which make perfect sense. The problem is that...
7
by: Jeff Uchtman | last post by:
I know I have done this but my mind is fried. I have a dynamic dropdown in a form. I need to pull both the dynamic dropdown's ID and name listed in the dropdown. Need a little help with grey...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
4
by: J MCallister | last post by:
Hello, I am working on a shopping cart where the viewer sees a dropdown with shipping options, each with a price. Elsewhere on the page is a display of the total. I am working on having the...
1
by: phpnewbie2007 | last post by:
I have 2 dynamic PHP dropdowns: The second dropdown populates from the first, depending on what is selected in the first. The page is showing issues in a department: The first dropdown...
1
by: bytesFTW99 | last post by:
I have been struggling with this for some time can anyone help out? just trying to have 3 dropdown boxes that fill depending on what is selected, then in some cases click a button and have the second...
2
by: raamay | last post by:
I want to have a dynamic dropdown box whose entries would depend on the selection of an entry in the first dropdown box. BUT the second dropdown box should not reload, only the entries inside should...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.