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 7 of 7
  1. #1
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts

    aargh, 3 validation issues

    Can someone tell what in the hell I am doing wrong?? I thought I would build my site in xhtml Strict but no matter what i do i cannot get of these last few errors

    1. Error Line 27 column 24: document type does not allow element "a" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

    <a name="topA" id="topA"></a>

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


    2. Error Line 53 column 66: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

    ...searchbox" type="text" class="searchbox" value="" />


    3. Error Line 54 column 119: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

    ...itle="source" alt="search" value="" /> </form>

  • #2
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Yo,
    Can you post all your code please, just so we can see where things are placed etc?
    Cheers.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,471
    Thanks
    6
    Thanked 980 Times in 953 Posts
    As far as I know anchors arenít allowed as direct children of the body as inputs arenít allowed as direct children of a form. You need to put them in a block-level element like a div or something.

    And also please stop using named anchors. Thatís so 90ís. Use IDs to reference an anchor point:
    Code:
    <div id="container">
      <a href="#container">to top</a>
    </div>
    Last edited by VIPStephan; 05-05-2007 at 12:31 AM.

  • #4
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks guys, VIP - i moved the anchor into a div and it worked so thank you my friend.

    i now have two errors left and here are the culprits (whicxh are already in a div??)

    <div id="search">
    <form action="" method="get" id="siteSearch">
    <input name="searchbox" type="text" class="searchbox" value="" />
    <input name="search" type="image" class="searchbutton" src="../imgs/arrow.gif" title="source" alt="search" value="" /> </form>
    </div>

  • #5
    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
    The form needs to start and end outside of the div. The input elements can't be direct childs of the form element. They must be in another block level element.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thanks aero, I moved my form tags outside the divs and the page at last validates!

    however, everything looks fine in ff but the searchbox is shoved over to the left in ie. when before, everything looked ok. i am guessing it is a style issue but everytime i rearrange the form still looks skewered in ie.

    <form action="" method="get" id="siteSearch">
    <div id="search">
    <input name="searchbox" type="text" class="searchbox" value="" />
    <input name="search" type="image" class="searchbutton" src="../imgs/arrow.gif" title="source" alt="search" value="" />
    </div></form>

    these are the styles involved:

    #search {
    width: 270px;
    height: 17px;
    margin-top: 12px;
    margin-left: 270px;
    margin-bottom: 0px;

    }
    #siteSearch {
    width: auto;
    margin: 0px;
    padding: 0px;
    }
    .searchbox {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: x-small;
    color: #000000;
    height: 14px;
    width: 210px;
    float: left;
    }
    .searchbutton {
    margin-top: 0px;
    height: 18px;
    width: 35px;
    border: 1px solid #000000;
    }

  • #7
    Regular Coder nexosis's Avatar
    Join Date
    Dec 2006
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could you please show a link to your site?

    progress: HTML: 100% > CSS: 90% > Javascript: 55% > Php:10%
    Want an avatar like mine? it's free! just pm me.


  •  

    Posting Permissions

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