By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,246 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,246 IT Pros & Developers. It's quick & easy.

Select tag how do i set length in mozilla?

P: n/a
Hi,
Check out this page,
http://www.abertron.co.uk/select.htm
How on earth do I shorten the box it but keep the same text. I've tried
a few javascript files but they only work with ie. Has anyone seen an
example somewhere or know how to do it.
The WC standards doesn't have a function to shorten the box it just goes
to the size of the text which I can't understand why. I would use a
different method but I just can't for my particular task.

Any ideas?

Thanks

Gary

Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Gary Mayor <ga**@abertron.co.uk> wrote:
Check out this page,
http://www.abertron.co.uk/select.htm
How on earth do I shorten the box it but keep the same text. I've tried
a few javascript files but they only work with ie. Has anyone seen an
example somewhere or know how to do it.
The WC standards doesn't have a function to shorten the box it just goes
to the size of the text which I can't understand why. I would use a
different method but I just can't for my particular task.


Set the width in CSS.

select {width: 20em;}

However this will hide the right hand end of the text from users of
some browsers, so it may be better to rewrite your content so that you
don't need to include such long options.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a

"Gary Mayor" <ga**@abertron.co.uk> wrote in message
news:bv**********@newsg3.svr.pol.co.uk...
Hi,
Check out this page,
http://www.abertron.co.uk/select.htm
How on earth do I shorten the box it but keep the same text. I've tried
a few javascript files but they only work with ie. Has anyone seen an
example somewhere or know how to do it.
The WC standards doesn't have a function to shorten the box it just goes
to the size of the text which I can't understand why. I would use a
different method but I just can't for my particular task.


1. Why would you want your users not to be able to see the full text of the
choices? Don't you think a list would look funny like this:

Afgha
Alban
Andor
Angol
Antig
Argen
Armen
Austr
Austr
Azerb
Baha
Bahrei
Bangl
Barba
...

? Also, note the failure to distinguish Austria from Australia.

2. Formatting is done with stylesheets, not script.

Jul 20 '05 #3

P: n/a
My users will be entering there own text and it needs to be able to
allow them to enter as much text as they want and it needs to come out
using a select box.
I'm looking into the CSS method if it works in ie and mozilla then it'll
do for me.

Thanks

Gary

Jul 20 '05 #4

P: n/a
On Tue, 27 Jan 2004 23:38:49 +0000, Gary Mayor <ga**@abertron.co.uk> wrote:
My users will be entering there own text and it needs to be able to
allow them to enter as much text as they want and it needs to come out
using a select box.
I'm looking into the CSS method if it works in ie and mozilla then it'll
do for me.

Thanks

Gary


My guess as to what you're after:

You're going to solicit user text through a textarea or an input
type="text". Then you're going to display it in a select box, presumably
using JS?

Still not sure what the problem is. Your Select box will size to the text
entered. If it's a lot of text, the select box will be wide like in your
example. If you want to limit the size, use the JS to truncate the string.

If you want them to enter as much text as they want and it is going to be
an option in a Select box, then why would you complain that the box is too
long? If you're allowing unlimited characters, theoretically the select
box would run off the edge of the page. That's what happens with long
values.

I assume you'd like the text to wrap, but it doesn't work that way. Select
options are one line high. Wrapping would lead to confusion. It's not a
bug, it's a feature.
Jul 20 '05 #5

P: n/a
Gary Mayor <ga**@abertron.co.uk> wrote:
My users will be entering there own text
You can't enter text into a select box.
and it needs to be able to
allow them to enter as much text as they want and it needs to come out
using a select box.
What does "it needs to come out using a select box" mean? I still
don't get why they would want their text to be chopped off like that.
I'm looking into the CSS method if it works in ie and mozilla then it'll
do for me.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.