Line break in <option> text

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
 
M

Mark Fitzpatrick

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
 
D

David Baxter

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>
 
T

Trevor L.

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
 
M

Murray

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
 
D

Dan L

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).
 
M

Murray

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
 
D

Dan L

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
 
S

Steve Easton

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
 
D

Dan L

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
 
T

Thomas A. Rowe

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
 
M

Murray

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
 
M

Murray

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
 
D

Dan L

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
 
T

Trevor L.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printing Error 3
Comment not read in Firefox 3
Image Toolbar 2
Clearing Cache ? 4
Embedding Video 2
Centering images 13
Cross refernce to fucntions in another fraem 1
JS not working in Forefox 8

Top