SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question XHTML Strict SELECT tag problem

    Hey guys,

    I got problem with SELECT tag when validating through XHTML 1.0 Strict (with XHTML 1.0 Transitional it passed validating), it says:

    "Document type does not allow element ... here; missing one of ... start-tag" and its pointing on my two SELECT tags.

    I can't post DOCTYPE in my code, becuase sitepoint is saying that I can't post links

    My XHTML code:

    Code:
    <html>
    <head>       
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta http-equiv="Content-Language" content="en" />    
        <title>1</title>
    </head>
    <body>
    
        <form action="action.php" method="post">
    
            <select>
          		  <option value="car"></option>   		
            </select>   
          
            <select>
          		  <option value="car2">car2</option>		
            </select>
            
        </form>
        
    </body>
    </html>

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    put the SELECTs inside Ps or inside a FIELDSET
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In a Strict doctype (HTML 4.01 Strict, XHTML 1.0 Strict or XHTML 1.1), the form element type doesn't allow inline children such as select. Only block-level elements may be children of form.

    Wrap your lists inside a block-level element. The most appropriate is fieldset (which requires a legend as the first child), but you can also use a div. I don't agree with Rudy's suggestion of using paragraphs, since this clearly doesn't constitute a paragraph of text.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •