Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7792131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:05:51+00:00 2026-06-01T22:05:51+00:00

I have a drop down list but the closing option tags are missing. This

  • 0

I have a drop down list but the closing option tags are missing. This causes the site to fail W3C Validation against XHTML 1.1

This is my HTML:

<select>
    <option value="">Select...
    <option value="val1">Value One
    <option value="val2">Value Two
</select>

where I expect this:

<select>
    <option value="">Select...</option>
    <option value="val1">Value One</option>
    <option value="val2">Value Two</option>
</select>

I have tried both HtmlSelect and DropDownList. I have tried adding ListItem and databinding in order to populate it but I get the same HTML every time.

Any idea what might be causing this?

EDIT

I’m using .NET 3.5, the site is a Sitecore site.

This is my doctype declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Populating like this:

HtmlSelect dropdown = new HtmlSelect();
dropdown.ID = _Data.ControlID;

List<DataCollectionItem> lisItemCollection = new List<DataCollectionItem>();

foreach (DataCollectionItem item in lisItemCollection)
    dropdown.Items.Add(new ListItem(item.Text, item.Value));

Have tried this too, with the same outcome:

dropdown.DataSource = lisItemCollection;
dropdown.DataTextField = "Text";
dropdown.DataValueField = "Value";
dropdown.DataBind();

Browser files:

Form.browser

<browsers>
  <browser refID="Default">
    <controlAdapters>
      <adapter controlType="System.Web.UI.HtmlControls.HtmlForm" adapterType="Sitecore.Web.FormAdapter, Sitecore.Kernel" />
    </controlAdapters>
  </browser>
</browsers>

w3cValidator.browser

<browsers> 
  <!--  Browser capability file for the w3c validator 
        sample UA: "W3C_Validator/1.305.2.148 libwww-perl/5.803" 
  --> 
  <browser id="w3cValidator" parentID="default"> 
    <identification> 
      <userAgent match="^W3C_Validator" /> 
    </identification> 

    <capture> 
      <userAgent match="^W3C_Validator/(?'version'(?'major'\d+)(?'minor'\.\d+)\w*).*" /> 
    </capture> 

    <capabilities> 
      <capability name="browser" value="w3cValidator" /> 
      <capability name="majorversion" value="${major}" /> 
      <capability name="minorversion" value="${minor}" /> 
      <capability name="version" value="${version}" /> 
      <capability name="w3cdomversion" value="1.0" /> 
      <capability name="xml" value="true" /> 
      <capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" /> 
    </capabilities> 
  </browser> 
</browsers>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:05:54+00:00Added an answer on June 1, 2026 at 10:05 pm

    It turns out the issue was due to the HTML Agility pack.

    HtmlNode.ElementsFlags.Remove("option");
    

    See this question for more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a drop down list <select onchange=alert(this.value);> <option selected=selected value=cat>cat</option> <option value=dog>dog</option> </select>
I have Drop Down List control and add dynamic add option into Dropdownlist but
I have a drop-down list as, <select id='idleReason' onChange=loadXMLDoc(this.value) size=1> <option value=nothing selected=selected>Select a
I have a drop-down list which causes a text-area to populate with different text
I have a drop-down list with numerical values: <select name=a> <option value=1>asdsadas</option> <option value=1>wqecsdc</option>
This is probably something really stupidly simple.. I have a drop down list bound
I have a drop down list and would like to remove an option from
I have created and html form which have a drop down list. This drop
I have a drop down list (select) populated from SQL. This is dynamic so
Suppose I have a drop-down list like: <select id='list'> <option value='1'>Option A</option> <option value='2'>Option

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.