| View previous topic :: View next topic |
| Author |
Message |
racco
Joined: 20 Nov 2005 Posts: 3
|
Posted: Sun Nov 20, 2005 1:04 am Post subject: HTML select tag |
|
|
Hello!
Do you know if there is any way to
cut very long <option> values short?
Maybe to present them in two lines or sth.
I have to do a form with <select> tag
and its <option> tags contain very long
phrases and it looks awfull.
There is no chance to cut them off to
the normal length, so I wonder whether
there is a way to let's say split the text
or sth.
Lookin forward to getting some support from you!!
racco |
|
| Back to top |
|
 |
|
|
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3642 Location: Sweden
|
Posted: Sun Nov 20, 2005 12:28 pm Post subject: Re: HTML select tag |
|
|
Hi and welcome to DEVPPL.
Without using and server language like PHP or ASP, maybe you can do like this:
| Code: |
| <select style="width:100px;"> |
I don't know if it can be done with javscript, but this is the way I would do it. |
|
| Back to top |
|
 |
racco
Joined: 20 Nov 2005 Posts: 3
|
Posted: Sun Nov 20, 2005 4:03 pm Post subject: Re: HTML select tag |
|
|
hello!
thx for your answer!
your solution works under FireFox but it seems to be useless with IE, because it reduces the width of selector box, but you cannot see the whole content of any long <option> row (under FF you see all when you are Over it)
what to do?
racco |
|
| Back to top |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3642 Location: Sweden
|
Posted: Mon Nov 21, 2005 12:24 am Post subject: Re: HTML select tag |
|
|
I don't know if there are any solutions for this in HTML and CSS. But do you have ASP or PHP installed on your server? If you have that, you can make some script that will cut of the sentence to like 70 characters and replace it bu three dots or something like that.
Do you know if you have PHP or ASP support on your server? |
|
| Back to top |
|
 |
racco
Joined: 20 Nov 2005 Posts: 3
|
Posted: Mon Nov 21, 2005 9:57 pm Post subject: Re: HTML select tag |
|
|
I have PHP and it is not problem for me tu cut the length of a string, I rather wanted to know whether there is a way to present a very long option in select box reduced to some width (let's say on mouse over this option there would be sth similar to alt or title over image displayed)
but anyway, I managed to change the length by reducing and paraphrasing some words from those options, so now it is ok
thx
racco |
|
| Back to top |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3642 Location: Sweden
|
Posted: Mon Nov 21, 2005 10:42 pm Post subject: Re: HTML select tag |
|
|
| Ok, good that you could solve it. There might be some solution for it in JavaScirpt, so if you want to add thoose extra words again, check if there're some javascript solution for it. |
|
| Back to top |
|
 |
|