Forum Home
Press F1
 
Thread ID: 67985 2006-04-12 23:24:00 Site validation problems Morgenmuffel (187) Press F1
Post ID Timestamp Content User
445970 2006-04-12 23:24:00 Hi all my site is failing the validation thingie at http://validator.w3.org/ and i can't seem to figure out the errors, as the site works fine in all tested browsers and the code doesn't look wrong to me
my html type is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org

First error

<form action="../index.php?page_ID=11" method="post">
gives
document type does not allow element "FORM" here

This is the section of code that gives the error



<tr>
<td colspan="3">
<div align="center">
<h2>Hello Possums</h2>

</div> </td>
</tr>
<form action="../index.php?page_ID=11" method="post">
<tr>
<td width="45%">Please select the region you are interested in from the list below </td>
<td width="5">&nbsp; </td>
<td width="45%">Please select the place you wish to work on from the list below </td>
</tr>

<tr>
<td width="40%">
<div align="left">
<Select name="region">
<Option value="all" selected>ALL</option>
<Option value="2">Auckland</option>
<Option value="4">Bay of Plenty</option>
<Option value="14">Canterbury</option>
</Select>

</div>
</td>
<td>&nbsp; </td>
<td width="40%">
<div align="left">
<Select name="farm">
<Option value="all" selected>ALL</option>
<Option value="7">Beef</option>
<Option value="1">Dairy</option>
<Option value="3">Deer</option>
</Select>
</div>
</td>
</tr>
<tr>
<td colspan="3"> <br>
<div align="center">
<input type="submit" Value="Find Job">
</div> </td>
</tr>
</form>
<tr>
<td colspan="3"> <br>
<div align="center">
<Hr>
</div>
</td>
</tr>



Second problem

<td colspan="3"> <a href="../index.php?page_ID=13&job_ID=59">
gives
cannot generate system identifier for general entity "job_ID".

Now there is an explanation underneath saying it could be caused by the amplisand being used in the code as in I should use
<a href="../index.php?page_ID=13&amp;job_ID=59">
instead of
<a href="../index.php?page_ID=13&job_ID=59">

Problem is I changed my code to match this suggestion but it doesn't appear on the page, confused? I am



<?php
require_once('bla_conn.php');
mysql_select_db($dbname, $conn);
$query_result = "not important";
$result=mysql_query($query_result, $conn)OR DIE(mysql_error());

while ($row_result = mysql_fetch_array($result)) { ?>
<tr valign="top">
<td colspan="3">
<a href="../index.php?page_ID=13&amp;job_ID=<?= $row_result['job_ID'] ?>">
<?= $row_result['job_name'] ?>
</a>
<font size="1">(click for full details)</font>
</td>
</tr>
<tr valign="top">
<td colspan="3">
<?php
$text = truncate_string($row_result['job_description'],120); ?>
<?= $text ?>
</td>
</tr>
<tr valign="top">
<td colspan="3">
<?= $row_result['region_name']?><br>
</td>
</tr>
<?php } ?>


When i look at the page source on the generated page it looks like this
<a href="../index.php?page_ID=13&job_ID=59">

Which works fine but obviously fails validation,
It has been checked in firefox and IE and has the same valadation problem in both

Any help would be appreciated
Morgenmuffel (187)
445971 2006-04-13 00:04:00 Hi all my site is failing the validation thingie at validator.w3.org

First error

<form action="../index.php?page_ID=11" method="post">
gives
document type does not allow element "FORM" here...

Try closing it with "</form>".


Second problem

<td colspan="3"><a href="../index.php?page_ID=13&job_ID=59">
gives
cannot generate system identifier for general entity "job_ID".

Now there is an explanation underneath saying it could be caused by the amplisand being used in the code as in I should use
<a href="../index.php?page_ID=13&amp;job_ID=59">
instead of
<a href="../index.php?page_ID=13&job_ID=59">

Problem is I changed my code to match this suggestion but it doesn't appear on the page, confused? I am

That should have fixed the problem. And I do see it in the pasted coded. Try the validation again.
vinref (6194)
445972 2006-04-13 00:44:00 </tr>
<form action="../index.php?page_ID=11" method="post">
<tr>It could also be that you are not allowed to put anything between the </tr> and <tr>. IIRC everything should actually be INSIDE a <tr> tag, no outside it.

"index.php?page_ID=13&job_ID=59"
Also, i think you might have to replace the & with &amp;
mejobloggs (264)
445973 2006-04-13 00:45:00 Thanks Vinref, I think I may have left some bits out of my explanation


Try closing it with "</form>" .
It is already being closed with a </form> tag just read down a bit further in the listed code



That should have fixed the problem . And I do see it in the pasted coded . Try the validation again .

Drat I should have been clearer, this is what is appearing on the page source of the generated page, see the &amp; has gone and been replaced with just an &


<tr valign="top">
<td colspan="3"><a href=" . . /index . php?page_ID=13&job_ID=57">
Assistant Manager</a> <font size="1">(click for full details)</font></td>
</tr>



I have tried it in both ie and firefox and I have cleared caches and rebooted browsers etc

Everything works as intended, it's just it doesn't validate
Morgenmuffel (187)
445974 2006-04-13 00:49:00 [CODE]

"index.php?page_ID=13&job_ID=59"
Also, i think you might have to replace the & with &amp;

Thats my problem, I have done that but it isn't coming through to the page

in my page code (shown in the fist post) it has the &amp; in it, but when I do a view source on the resultant page the &amp; has been replaced with &

Now i'm not sure if it is the php parser thingy doing it or apache or what but it is causing it to fail validation
Morgenmuffel (187)
445975 2006-04-13 01:00:00 Ok first problem is solved

I put the form in a table cell and then put the form content in to their own table

Th only problem with this is i can't work out how to get rid of the border (set by css for all tables) round the table border="0" doesn't work, i guess i'll have to create a style for this table that doesn't include borders

The second problem is the one that baffles me though, i can't see any logic to what is happening
Morgenmuffel (187)
1