Line break in <option> text

  • Thread starter Thread starter Trevor L.
  • Start date Start date
T

Trevor L.

I have this code:
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://........./">
Martin's ACTION Bus Photos</option>
<option value="http://......../.">
Graham "Speed" Down's Website</option>
</select>
</form>

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the form, and
I would prefer it to be narrower with each box deeper (so as to fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Unfortunately, no. Linebreaks have no effect on the visual appearance of an
select. You can use Cascading StyleSheets (CSS) to try to change the
appearance, such as using a narrower font and smaller font size for the
list.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
If what you are trying to do is keep different drop-down option boxes
the same width, try adding a dummy line with dashes or something...

<option value="null">Select option</option>
<option value="null">------------------------------------------</option>
 
Thanks, David
I can understand how this would make all lines the same length as the line
of dashes

But what I want to do is to change a select that looks like this
----------------------------------
--Select one-- V <- this is the down arrow
----------------------------------
Martin's ACTION Bus Photos
----------------------------------
Graham "Speed" Down's Website
----------------------------------
(where the lines of dashes separate each option)

to
-------------------
--Select one-- V
-------------------
Martin's ACTION
Bus Photos
-------------------
Graham "Speed"
Down's Website
-------------------
That is, *reduce* the width of each option box, but make each multi-line

I have been advised by another expert (I forget whom - see this thread) that
it can't be done.
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

David said:
If what you are trying to do is keep different drop-down option boxes
the same width, try adding a dummy line with dashes or something...

<option value="null">Select option</option>
<option
value="null">------------------------------------------</option>


Trevor L. said:
I have this code:
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://........./">
Martin's ACTION Bus Photos</option>
<option value="http://......../.">
Graham "Speed" Down's Website</option>
</select>
</form>

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the
form, and I would prefer it to be narrower with each box deeper (so
as to fit in a narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Trevor:

It's not possible to do this....

--
Murray
============

Trevor L. said:
Thanks, David
I can understand how this would make all lines the same length as the line
of dashes

But what I want to do is to change a select that looks like this
----------------------------------
--Select one-- V <- this is the down arrow
----------------------------------
Martin's ACTION Bus Photos
----------------------------------
Graham "Speed" Down's Website
----------------------------------
(where the lines of dashes separate each option)

to
-------------------
--Select one-- V
-------------------
Martin's ACTION
Bus Photos
-------------------
Graham "Speed"
Down's Website
-------------------
That is, *reduce* the width of each option box, but make each multi-line

I have been advised by another expert (I forget whom - see this thread)
that it can't be done.
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

David said:
If what you are trying to do is keep different drop-down option boxes
the same width, try adding a dummy line with dashes or something...

<option value="null">Select option</option>
<option
value="null">------------------------------------------</option>


Trevor L. said:
I have this code:
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://........./">
Martin's ACTION Bus Photos</option>
<option value="http://......../.">
Graham "Speed" Down's Website</option>
</select>
</form>

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the
form, and I would prefer it to be narrower with each box deeper (so
as to fit in a narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham "Speed" or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham "Speed"
Down's Website).
 
What?

--
Murray
============

Dan L said:
A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham "Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham "Speed"
Down's Website).

Trevor L. said:
I have this code:
My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br> \n)

As it exists, the length of the text in the option tag widens the form,
and
I would prefer it to be narrower with each box deeper (so as to fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
BTW, the "n b s p ;" didn't show up in my post. I indented the second line
of the two line entries with two spaces.

Dan L said:
A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham "Speed" or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham "Speed"
Down's Website).

Trevor L. said:
I have this code:
My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br> \n)

As it exists, the length of the text in the option tag widens the form, and
I would prefer it to be narrower with each box deeper (so as to fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Like this by using an option with a null value:

<SELECT id=select1 name=select1 onchange="doNav(this);">
<OPTION value="" selected>Please select a site</OPTION>
<OPTION value="http://www.apple.com/">Apple.com</OPTION>
<option value="">------------------</option>
<OPTION value="http://www.salon.com/">Salon.com</OPTION>
<option value="">------------------</option>
<OPTION value="http://www.moveon.org/">Moveon.Org</OPTION>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer

Trevor L. said:
Thanks, David
I can understand how this would make all lines the same length as the line
of dashes

But what I want to do is to change a select that looks like this
----------------------------------
--Select one-- V <- this is the down arrow
----------------------------------
Martin's ACTION Bus Photos
----------------------------------
Graham "Speed" Down's Website
----------------------------------
(where the lines of dashes separate each option)

to
-------------------
--Select one-- V
-------------------
Martin's ACTION
Bus Photos
-------------------
Graham "Speed"
Down's Website
-------------------
That is, *reduce* the width of each option box, but make each multi-line

I have been advised by another expert (I forget whom - see this thread) that
it can't be done.
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

David said:
If what you are trying to do is keep different drop-down option boxes
the same width, try adding a dummy line with dashes or something...

<option value="null">Select option</option>
<option
value="null">------------------------------------------</option>


Trevor L. said:
I have this code:
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://........./">
Martin's ACTION Bus Photos</option>
<option value="http://......../.">
Graham "Speed" Down's Website</option>
</select>
</form>

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the
form, and I would prefer it to be narrower with each box deeper (so
as to fit in a narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
See http://www.qualitybass.org/test.htm

Murray said:
What?

--
Murray
============

Dan L said:
A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham "Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham "Speed"
Down's Website).

Trevor L. said:
I have this code:

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br> \n)

As it exists, the length of the text in the option tag widens the form,
and
I would prefer it to be narrower with each box deeper (so as to fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
All you did was to enter the same URL 3 times with different wording.

<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.yahoo.com">&nbsp;&nbsp;Search</option>
<option value="http://www.yahoo.com">&nbsp;&nbsp;&nbsp;Engine</option>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Dan L said:
See http://www.qualitybass.org/test.htm

Murray said:
What?

--
Murray
============

Dan L said:
A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham "Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham "Speed"
Down's Website).

:

I have this code:

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the form,
and
I would prefer it to be narrower with each box deeper (so as to fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
None of those are what the OP was asking about, though. The question was
whether you could put in a line break within an <option>.

--
Murray
============

Thomas A. Rowe said:
All you did was to enter the same URL 3 times with different wording.

<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.yahoo.com">&nbsp;&nbsp;Search</option>
<option value="http://www.yahoo.com">&nbsp;&nbsp;&nbsp;Engine</option>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Dan L said:
See http://www.qualitybass.org/test.htm

Murray said:
What?

--
Murray
============

A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham
"Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham
"Speed"
Down's Website).

:

I have this code:

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the
form,
and
I would prefer it to be narrower with each box deeper (so as to fit
in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Oh. Ew. 8)

--
Murray
============

Dan L said:
See http://www.qualitybass.org/test.htm

Murray said:
What?

--
Murray
============

Dan L said:
A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham
"Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham
"Speed"
Down's Website).

:

I have this code:

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the
form,
and
I would prefer it to be narrower with each box deeper (so as to fit in
a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
If all users were intuitive enough, you'd only have to hyperlink the first
word and let "search" and "engine" be dead. Doing it this way though, if
they click on "Yahoo" or "Search" or "Engine" it goes to Yahoo. Trevor
wanted a *narrow* drop down menu, so I just thought I'd offer this method as
an alternative.

Thomas A. Rowe said:
All you did was to enter the same URL 3 times with different wording.

<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.yahoo.com"> Search</option>
<option value="http://www.yahoo.com"> Engine</option>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Dan L said:
See http://www.qualitybass.org/test.htm

Murray said:
What?

--
Murray
============

A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham "Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham "Speed"
Down's Website).

:

I have this code:

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the form,
and
I would prefer it to be narrower with each box deeper (so as to fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Dan L., Murray and Thomas

I thought Dan's suggestion was a good compromise to overcome something that
can't be done exactly as I want it.

Thomas,
I did understand that the same reference appeared in two different boxes,
but it would have to in order to achieve the desired result.

Thanks again to all
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
Oh. Ew. 8)

--
Murray
============

Dan L said:
See http://www.qualitybass.org/test.htm

Murray said:
What?

--
Murray
============

A little unorthodox, but how 'bout this?
<form>
<select onChange="if(options[selectedIndex].value)
top.location.href=(options[selectedIndex].value)">
<option>---Select one---</option>
<option value="http://Martin/">
Martin's ACTION</option>
<option value="http://Martin/">
Bus Photos</option>
<option value="http://Graham/.">
Graham "Speed"</option>
<option value="http://Graham/.">
Down's Website</option>
</select>
</form>

If visitors click on either Martin's ACTION or Bus Photos (Graham
"Speed"
or
Down's Website) it takes them to Martin ACTION Bus Photos (Graham
"Speed"
Down's Website).

:

I have this code:

My query is:
Can I put line breaks in the text after the option tag?
(I have tried the normal things: <br>
\n)

As it exists, the length of the text in the option tag widens the
form,
and
I would prefer it to be narrower with each box deeper (so as to
fit in a
narrow frame)

Can this be done?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Back
Top