CSS issue driving me up the wall!

When I validate the output of a php page in W3C, I get the following errors on the code below.

Line 68, Column 96: document type does not allow element “FORM” here; missing one of “TH”, “TD” start-tag
…ttp://www.fietsdepot.com/search.php">

Line 69, Column 57: document type does not allow element “TD” here
…<td width=“78%” align=“left”><input type=“hidden” name=“posted” value

Error Line 71, Column 57: document type does not allow element “TD” here
…<td width=“22%” align=“left”><input name=“Submit” type=“image” src="i

Line 72, Column 38: end tag for “TR” which is not finished
</form></tr>

The code is:

<tr><form method="POST" action="">
<td width="78%" align="left"><input type="hidden" name="posted" value="1">
<input name="stext" type="text" class="searchbox" value="Artikel" onFocus="if (this.value=='Artikel) { this.value='';}" onBlur="if (this.value=='') { this.value='Artikel...';}" size="22"> </td>
<td width="22%" align="left"><input name="Submit" type="image" src="images/nav/searchbut.gif" alt="Search this site"></td>
</form></tr>

PLEASE look into this and tell me how to solve this. I have wasted hour son this so far…

Thanks

[URL=“http://www.fietsdepot.com/categories.php”]

Hi,

It’s actually an HTML question but that’s fine…
Those errors seem pretty self-explanatory to me.
You can’t have the form within a tr tag validly. A tr can only contain elements like th and td.

The solution is to move the form outside of the table altogether


<form>
<table>
</table>
</form>

Hope it helps :slight_smile:

Hi, the problem is that you have a <form> inside a <tr> but there is no <td> tag AFTER the form is created, which is invalid. You CAN have a form inside a table but it has to be inside a <td> (all content must)
Move the form to start inside the <td> :). If you need it to span across multiple cells, then nest a <table> inside the form and create the 2 cells there.

Thanks Mark!
Works perfectly.