Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Validation

  1. #1
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts

    Validation

    How would you validate this in xhtml strict? I had a look on google but everyone seemed to be doing it the exact same way.

    Code:
    <label for="contactYou" class="fixedwidth">Best way to contact you?</label>
           <select name="contactYou" id="contactYou">     
                    <option>Home</option>
                    <option>Work</option>
                    <option>Mobile</option>    
          </select>

    Error Line 111, Column 28: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

    <label for="contactYou">Best way to contact you?</label>

    Thanks,
    Josh

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Those elements need to be inside of a fieldset or paragraph element. A fieldset is probably most semantic. You could use a paragraph but that won't really be semantic. Neither will the other elements.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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