Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Is </OPTION> optional?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Swifty  
View profile  
 More options May 2 2012, 11:26 am
Newsgroups: comp.infosystems.www.authoring.html
From: Swifty <steve.j.sw...@gmail.com>
Date: Wed, 02 May 2012 16:26:38 +0100
Local: Wed, May 2 2012 11:26 am
Subject: Is </OPTION> optional?
I can't remember where I learned HTML, but I remember that there is no
</OPTION> tag in HTML (but browsers don't care if you have them)

I've discovered that I sometimes get blank entries in my <SELECT>
controls, even though none of the <OPTION>'s are blank. This happens
with the current Opera browser (and back quite a few releases).

The workaround is to add the un-necessary, and possible illegal
</OPTION> tags.

Presumably this is a problem that I should report to Opera, but I
thought I'd check my facts first.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile  
 More options May 2 2012, 11:53 am
Newsgroups: comp.infosystems.www.authoring.html
From: Barry Margolin <bar...@alum.mit.edu>
Date: Wed, 02 May 2012 11:53:41 -0400
Local: Wed, May 2 2012 11:53 am
Subject: Re: Is </OPTION> optional?
In article <j6k2q79ihed6srqhqvkp4c7copob4lm...@4ax.com>,

 Swifty <steve.j.sw...@gmail.com> wrote:
> I can't remember where I learned HTML, but I remember that there is no
> </OPTION> tag in HTML (but browsers don't care if you have them)

> I've discovered that I sometimes get blank entries in my <SELECT>
> controls, even though none of the <OPTION>'s are blank. This happens
> with the current Opera browser (and back quite a few releases).

> The workaround is to add the un-necessary, and possible illegal
> </OPTION> tags.

> Presumably this is a problem that I should report to Opera, but I
> thought I'd check my facts first.

You've got it backwards. </OPTION> is legal, but optional in some
contexts.

http://www.w3.org/TR/html5/syntax.html#syntax-tag-omission

says:

An option element's end tag may be omitted if the option element is
immediately followed by another option element, or if it is immediately
followed by an optgroup element, or if there is no more content in the
parent element.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options May 2 2012, 12:20 pm
Newsgroups: comp.infosystems.www.authoring.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Wed, 02 May 2012 12:20:34 -0400
Local: Wed, May 2 2012 12:20 pm
Subject: Re: Is </OPTION> optional?

Swifty wrote:
> I can't remember where I learned HTML, but I remember that there is no
> </OPTION>  tag in HTML (but browsers don't care if you have them)

> I've discovered that I sometimes get blank entries in my<SELECT>
> controls, even though none of the<OPTION>'s are blank. This happens
> with the current Opera browser (and back quite a few releases).

> The workaround is to add the un-necessary, and possible illegal
> </OPTION>  tags.

It is not illegal, it is optional in HTML 4.01, but required in XHTML. I
typically put in all optional closing tabs because it fined it makes it
easier to debug and see my errors...

When in doubt, why not look it up?

http://www.w3.org/TR/html401/index/elements.html

> Presumably this is a problem that I should report to Opera, but I
> thought I'd check my facts first.

With out the code in question, it is hard to say if there is a bug in
Opera or *your* markup.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dorayme  
View profile  
 More options May 2 2012, 6:32 pm
Newsgroups: comp.infosystems.www.authoring.html
From: dorayme <dora...@optusnet.com.au>
Date: Thu, 03 May 2012 08:32:42 +1000
Local: Wed, May 2 2012 6:32 pm
Subject: Re: Is </OPTION> optional?
In article <jnrmsj$n4...@dont-email.me>,
 "Jonathan N. Little" <lws4...@gmail.com> wrote:

> Swifty wrote:
> > I can't remember where I learned HTML, but I remember that there is no
> > </OPTION>  tag in HTML (but browsers don't care if you have them)

I think it was optional even in 3.2 days but I am not surprised at
your memory because the typical examples (you could see them pasted
inside the cabins of horse drawn buggies) are as in

<http://www.w3.org/TR/REC-html32#select>

Odd things can happen in quirks mode where browsers make out however.
In such mode, a browser can fail to trigger an implicit close of a
prior element and maybe all sort of other things can happen. So it
would be interesting to see the markup that gives Swifty this problem.

--
dorayme


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jukka K. Korpela  
View profile  
 More options May 3 2012, 12:48 am
Newsgroups: comp.infosystems.www.authoring.html
From: "Jukka K. Korpela" <jkorp...@cs.tut.fi>
Date: Thu, 03 May 2012 07:48:59 +0300
Local: Thurs, May 3 2012 12:48 am
Subject: Re: Is </OPTION> optional?

2012-05-03 1:32, dorayme wrote:
>>> I can't remember where I learned HTML, but I remember that there is no
>>> </OPTION>   tag in HTML (but browsers don't care if you have them)

> I think it was optional even in 3.2 days

The </OPTION> tag has always been optional in HTML; in XHTML it is
required of course.

End tags are forbidden in HTML only for elements with EMPTY declared
content, such as <BR>. The OPTION element has (#PCDATA)* declared
content, i.e. plain text content; even though this includes the
possibility of the empty string, this is quite different from elements
with EMPTY declared content. So <OPTION></OPTION> is valid.

> Odd things can happen in quirks mode where browsers make out however.

And even in "standards" mode. Even more surprisingly, the omission of
the optional </p> tag may trigger very nasty bugs on IE 7, IE 8, IE 9 in
"standards mode", bugs that do not exist in quirks mode! See
http://www.cs.tut.fi/~jkorpela/quirks-mode.html#iebug

> In such mode, a browser can fail to trigger an implicit close of a
> prior element and maybe all sort of other things can happen. So it
> would be interesting to see the markup that gives Swifty this problem.

It would indeed be interesting as a theoretical issue. The practical
conclusion, however, is simple: it's safer to close all elements with
explicit end tags, except for the elements with EMPTY declared content.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dorayme  
View profile  
 More options May 3 2012, 7:56 am
Newsgroups: comp.infosystems.www.authoring.html
From: dorayme <dora...@optusnet.com.au>
Date: Thu, 03 May 2012 21:56:53 +1000
Local: Thurs, May 3 2012 7:56 am
Subject: Re: Is </OPTION> optional?
In article <jnt2no$as...@dont-email.me>,
 "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:

> > Odd things can happen in quirks mode where browsers make out however.

> And even in "standards" mode. Even more surprisingly, the omission of
> the optional </p> tag may trigger very nasty bugs on IE 7, IE 8, IE 9 in
> "standards mode", bugs that do not exist in quirks mode! See
> http://www.cs.tut.fi/~jkorpela/quirks-mode.html#iebug

Interesting. I believe you without looking. As you so truly say, best
course is to close all elements that have end tags. I have my editor
set to disclose and warn and even fix any failure to observe this.

> > In such mode, a browser can fail to trigger an implicit close of a
> > prior element and maybe all sort of other things can happen. So it
> > would be interesting to see the markup that gives Swifty this problem.

> It would indeed be interesting as a theoretical issue. The practical
> conclusion, however, is simple: it's safer to close all elements with
> explicit end tags, except for the elements with EMPTY declared content.

--
dorayme

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Swifty  
View profile  
 More options May 4 2012, 10:48 am
Newsgroups: comp.infosystems.www.authoring.html
From: Swifty <steve.j.sw...@gmail.com>
Date: Fri, 04 May 2012 15:48:54 +0100
Local: Fri, May 4 2012 10:48 am
Subject: Re: Is </OPTION> optional?
On Thu, 03 May 2012 08:32:42 +1000, dorayme <dora...@optusnet.com.au>
wrote:

>So it
>would be interesting to see the markup that gives Swifty this problem.

I'll have to see if I can generate some test HTML. The original is on
our corporate Intranet so accessible only to those who've taken the
pledge.

The HTML is generated by a CGI script. In the past, I've saved the
page as a simple HTML file, and that never causes the problems. The
problem also only ever happens in Opera. I'm not in quirks mode,
unless some of my "creative" HTML has forced Opera to change its mind,
after encountering the:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Reloading the page also makes the problem come and go, but as it's
generated by a CGI script, that might just be down to the script
intermittently generating empty <OPTION> tags. It is not doing this,
my first step whenever I get these blank options is to look at the
source, and the options are never blank. The first one often carries a
null VALUE, but that's not the same thing.

As you may imagine, the CGI script generates the sequence of <OPTION>
tags by running a simple loop. Adding the optional </OPTION> tags is a
trivial 9-character patch to my code. Once this is in place, the
problem never comes back...

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »