SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xhtml validation

    Hello,

    I am trying to validate a XHTMl 1.1 form on w3.org but get the message:

    Line 57, Column 43: document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag

    <input type="text" name="name" size="50" />

    the code i am using is:

    Code:
     <form method="post" action="name.php">
      <p>namep>
    <input type="text" name="name" size="50" />
    <p>info:</p> 
        <p>
          <textarea name="info" rows="8" cols="60"></textarea>
          </p>
        <p>
          <input type="text" name="enter" value="enter" />
            </p>
    </form>
    any help would be great.

    Thanks guys.

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code HTML4Strict:
    <p>namep>
    Not sure what that is, but what it is saying is that the inputs need to be surrounded in a block level element:
    Code HTML4Strict:
    <form method="post" action="name.php">
     <div>
      <label for="name">Name</label><br /> 
      <input type="text" name="name" id="name" size="50" /><br />
      <label for="message">Info</label><br /> 
      <textarea name="info" rows="8" cols="60" id="message"></textarea><br />
      <input type="button" name="enter" value="enter" />
     </div>
    </form>
    That should work!

    The forum did not like the : (colon) in the code after teh label names. Also why using XHTML 1.1?

  3. #3
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also on top of what BPartch said, you could add a fieldset and legend
    Code HTML4Strict:
    <form action="">
        <fieldset>
            <legend>...</legend>
            ....
        </fieldset>
    </form>

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Also on top of what BPartch said, you could add a fieldset and legend
    Code HTML4Strict:
    <form action="">
        <fieldset>
            <legend>...</legend>
            ....
        </fieldset>
    </form>
    I was gonna mention that, but figured I'd wait til the OP replied.


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
  •