selected=selected in the center of option list

J

John

Hi

I have <option value='6' selected=selected>whatever</option> in a <select>
list.

In IE the option appears at the top of the list.
in FF it appears at the bottom of the list.

Any way of getting the option to appear in the middle of the list?

Regards
John
 
R

rf

John said:
Hi

I have <option value='6' selected=selected>whatever</option> in a <select>
list.

In IE the option appears at the top of the list.
in FF it appears at the bottom of the list.

Any way of getting the option to appear in the middle of the list?

Is there any possible way you can give us any less information?

For example not providing the URL to the offending page. Or not even
providing the full <select> element?

In any case I determine that you have an error in line 42.
 
H

Harlan Messinger

John said:
Hi

I have <option value='6' selected=selected>whatever</option> in a <select>
list.

In IE the option appears at the top of the list.
in FF it appears at the bottom of the list.

Any way of getting the option to appear in the middle of the list?

If you have

selected=selected

then the tag is invalid. If your document is meant to be HTML, then it
should just be

selected

If it's meant to be XHTML, then it needs to be

selected="selected"

because attribute values must be quoted in XHTML.

I don't know if fixing that will solve your problem, but other than that
I have no way to know what the source of your problem is because you
haven't shared any of your code outside of that one option element.
 
J

Jukka K. Korpela

Harlan said:
If you have

selected=selected

then the tag is invalid.

No it isn't.
If your document is meant to be HTML, then it
should just be

selected

No, selected=selected and selected="selected" and selected='selected' are
all permitted and equivalent in HTML up to and including HTML 4.01. Ref.:
the end of
http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3.4
(which is outdated, as browsers that only recognize the minimized form must
be really rare nowadays).

The shorthand that consists of the value selected only is often described as
being the attribute name without value, but by the SGML standard, and hence
formally in HTML up to and including HTML 4.01, it is the value of an
attribute. However, in this special case, the attribute value must not
appear in quotation marks. Rather confusing, isn't it?

This explains the oddity that in a <table> tag, the word border may appear
alone and it means frame="border". It's thus interpreted as the value of the
attribute that has this value as one of the possible enumerated values. In
principle, you could also use <table hsides rows> (try it on a validator if
you don't believe me) and it would mean <table frame="hsides" rules="row">
but don't expect browsers to grok it. In practice, browsers don't do SGML
parsing but some kludgery, which among other things deals with <table
If it's meant to be XHTML, then it needs to be

selected="selected"

Or selected='selected', to be exact.
I don't know if fixing that will solve your problem,

I don't think the problem has anything to do with the format of the
attribute used, or that attribute at all.

The problem is most probably in the code that was used to generate the
markup client-side via JavaScript, thereby exhibiting differences between
browsers. I might be stretching my crystal ball too much, but the error
seems to be at line 42 of the code. I might be wrong here of course. What is
fairly certain is that the URL is needed if the OP wants his problem solved
and not just enjoy our lectures (which are of course infinitely more
interesting than some casual boring practical authoring issue, in a context
where the whole approach is probably wrong).
 
D

dorayme

"rf said:
Is there any possible way you can give us any less information?

For example not providing the URL to the offending page. Or not even
providing the full <select> element?

These last possibilities are actualities in this case. Less
information would have to be something like providing a totally
irrelevant URL that throws any would-be helper off even a wild
guess.
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top