Help with validation

liunx

Guest
I have a website where I have a counter hosted by my ISP.<br />
<br />
It is displayed as an image with this code:<br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"http://cgihotel.uni2.dk/scripts/nph-count?width=5&link=user&increase=1"><br />
<br />
But when trying to validate the site using the w3c HTML4.01 Transitional validator I get the following error:<br />
<br />
Error: unknown entity link<br />
# Line 89, character 74:<br />
<br />
...h-count?width=5&link=user&increase="...<br />
<br />
<br />
Can anyone help me how I can get my the site validated so I won't get this error?<!--content-->Hi!<br />
<br />
If you replace all instances of '&' with '&amp;' and add an alt attribute to your image tag, that part of your site will validate.<br />
<br />
Cheers - Pit<!--content-->Thank you so much!<!--content-->Hi!<br />
<br />
You're validated -erm- welcome! :p<br />
<br />
Cheers - Pit<!--content-->I've got a validation problem.<br />
<br />
Apparently you can't have a form (or more specifically the form element of <input> for the more picky) inside of a div. It's naughty to have a block level element indide of an inline element.<br />
<br />
So if I wanna stick a form in a page somewhere, am I going to have to clear out an area of the page and have to reshape and rearrange a load of divs just so I can put a form on the page that won't sit in a div, or are there some more sensible soloutions?<!--content-->Hi!<br />
<br />
What's wrong with putting a form with whatever elements into a div??Taken from: <!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-DIV">http://www.w3.org/TR/REC-html40/struct/ ... l#edef-DIV</a><!-- m --><br />
<br />
The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements define content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content.<br />
<br />
A problem you might face with a form in a div is, that certain browsers need a special reference for the form and its' elements then (e.g. NS4.x).<br />
<br />
Regards - Pit<!--content-->No forms not in span (inline) elements, although I never heard of no forms in block level divisions.<!--content-->Here's what I got and what I'm getting.<br />
<br />
What I got:<br />
<body><br />
<div id="container"><br />
<img id="imgblam" src=http://www.webdeveloper.com/forum/archive/index.php/"images/blam2point4.jpg" alt="Welocome to Vagusnet.com" /><br />
<br />
<div id="admin"><br />
<form method="post" action="setcookie.php"><br />
<input type="text" name="uname" /><br />
<input type="submit" value="Set name" /><br />
</form><br />
<form method="post" action="adminprocess.php"><br />
<input type="text" name="newsheight" /><br />
<input type="submit" value="Alter size" /><br />
</form><br />
<br />
</div> <br />
<br />
and here's what I'm getting:<br />
<br />
<br />
<br />
Line 18, column 34: 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<br />
<br />
<input type="text" name="uname" /><br />
<br />
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.<br />
<br />
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>").<!--content-->Hi!<br />
<br />
Please view the source code of this and click the validation icon: <!-- m --><a class="postlink" href="http://www.pit-r.de/validateW3formInDiv.htm">http://www.pit-r.de/validateW3formInDiv.htm</a><!-- m --><br />
<br />
Cheers - Pit<!--content-->Mr. Herer, the error you are receiving is because the elements within the FORM element need to be enclosed within a block-level element (odd, considering FORM is a block-level element). To solve your problem, you can use am unstyled, semantically meaningless DIV, like so:<br />
<br />
<form action="" method="post"><br />
<div><br />
<!-- FORM inputs here --><br />
</div><br />
</form><br />
<br />
Or, you could use the FIELDSET and LEGEND elements — just need a block-level element encompasing your form elements. ;)<!--content-->I love that picture :D ... and home page :D (my idea!)<br />
<br />
... are you validating strict or transitional?<!--content-->Hi!I love that picture ... and home page (my idea!)Yeah - sometimes, I have to stee(a)l from you. :p<br />
<br />
I used the soft version: transitional; despite of the '/>' tag closings.<br />
<br />
Cheers - Pit<!--content-->well that's certainly one of the wierdest things I've seen to come out of the w3c validator. I thought about doing that but thought it'd be best to check and see if there isn't some actual underlying problem, rather than simply slapping in extra mark-up just to force validation.<br />
<br />
Splendid work folks, thanks for the help. :D<br />
<br />
Oh and whilst we're on validation, what's the standard practice in validating from php files?<br />
<br />
The validator always complains about my .php extension and gives me the "yellow card". :(<!--content-->
 
Back
Top