Was told my html form doesn't pass w3c guidelines for "proper" html. Tried the validator tool on it, but it doesn't parse small amount of html. Can anyone suggest a tool? Here's my HTML below, looks alright to me: <FORM id=s class="v1" name="schina" action="http://www.uncoverchina.com/"> <table width="125" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333" summary="Uncover China Search Box"> <tr> <td valign="middle"> <TABLE WIDTH=123 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0 bgcolor="#FFFFFF"> <TR> <TD COLSPAN=2> <input type=hidden name=fr value=searchbox> <IMG SRC="http://www.uncoverchina.com/images/box_now.gif" WIDTH=123 HEIGHT=21 ALT="Search Now"> </TD> </TR> <TR> <TD height="30" COLSPAN=2><img src="http://www.uncoverchina.com/images/box_spacer.gif" width="1" height="1"> <input type=hidden name=toggle value=1> <input name="q" type="text" id=fp size="13" maxlength="65"> </TD> </TR> <TR> <TD width="50"> <input type="image" src="http://www.uncoverchina.com/images/box_chop.gif" WIDTH=57 HEIGHT=57 border="0"> </TD> <TD valign="top"> <input type="hidden" name="ds" value="Search"> <input type="image" src="http://www.uncoverchina.com/images/box_button.gif" alt="Go" name="go" width="60" height="40" border="0"> </TD> </TR> <TR> <TD COLSPAN=2> <input type="image" src="http://www.uncoverchina.com/images/box_uc.gif" ALT="Uncover China - China Search Directory" WIDTH=125 HEIGHT=12 border="0"> </TD> </TR> </TABLE> </td> </tr> </table> </FORM>
Haven't got it in action as it's on a dynamic page, only I've tested it and works ok - just got complaints that it doesn't parse correctly. Here's a screenshot of what it should look like
Assuming you're using HTML 4.01 doctype the code below will validate using W3C validator. There were two problems with the code: The first table uses bordercolor attribute Image inputs uses width, height and alt attributes These problems can be circumvented using css, i.e. style attributes. <form id="s" class="v1" name="schina" action="http://www.uncoverchina.com/"> <table width="125" border="1" cellpadding="0" cellspacing="0" style="border-color:#333" summary="Uncover China Search Box"> <tr> <td valign="middle"> <table width="123" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2"> <input type="hidden" name="fr" value="searchbox"> <img src="http://www.uncoverchina.com/images/box_now.gif" width="123" height="21" alt="Search Now"> </td> </tr> <tr> <td height="30" colspan="2"> <img src="http://www.uncoverchina.com/images/box_spacer.gif" width="1" height="1" alt=""> <input type="hidden" name="toggle" value="1"> <input name="q" type="text" id="fp" size="13" maxlength="65"> </td> </tr> <tr> <td width="50"> <input type="image" src="http://www.uncoverchina.com/images/box_chop.gif" style="width:57px;height:57px;border:none;"> </td> <td valign="top"> <input type="hidden" name="ds" value="Search"> <input type="image" src="http://www.uncoverchina.com/images/box_button.gif" style="width:60px;height:40px;border:none;" title="Go" name="go"> </td> </tr> <tr> <td colspan="2"> <input type="image" src="http://www.uncoverchina.com/images/box_uc.gif" title="Uncover China - China Search Directory" style="width:125px;height:12px;border:none;"> </td> </tr> </table> </td> </tr> </table> </form> HTML:
Thanks for changing it, works and looks great. I did think of using Stylesheets to get around the problem but since I wanted to make the code easy to copy and paste for anyone to put on their sites, I thought it would be better not to ask users to amend their CSS also.