...

View Full Version : aargh, 3 validation issues



KevinG
05-04-2007, 11:09 PM
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 :mad: :mad: :mad:

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>

JamieR
05-05-2007, 12:13 AM
Yo,
Can you post all your code please, just so we can see where things are placed etc?
Cheers.

VIPStephan
05-05-2007, 12:29 AM
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:


<div id="container">
<a href="#container">to top</a>
</div>

KevinG
05-05-2007, 08:50 AM
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>

_Aerospace_Eng_
05-05-2007, 09:47 AM
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.

KevinG
05-05-2007, 11:13 AM
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;
}

nexosis
05-05-2007, 05:16 PM
Could you please show a link to your site?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum