PDA

View Full Version : Quick compliance question with form submission


Guest210212002
05-07-2007, 04:18 PM
I've put a search box in my navbar, and it's failing W3's validator.

Code is thus:


<!-- Search Box -->
<td style="background: #333333 url(http://www.sevenstring.org/forum/images/misc/snav_gradient.jpg);" valign="middle" class="alt1" width="180"><form action="http://www.sevenstring.org/forum/search.php" method="post">
<input type="text" class="bginput" style="font-size: 10px" size="15" name="query" value="Search" onFocus="if (this.value == 'Search') this.value = '';" /><input style="font: bold 10px Arial" type="submit" class="button" value="Search" /><input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="quicksearch" value="1" />
</form></td>
<!-- /Search -->

It bounces two errors:

There is no attribute "onFocus":

... name="query" value="Search" onFocus="if (this.value == 'Search') this.value

duplicate specification of attribute "style"

... class="alt1" nowrap="nowrap" style="padding:0px"> <form action="http://www

I'm not sure what's making it unhappy. Style is defined twice, but once for the text that shows up in the box, the other for the button itself.

* Guest210212002 scratches his head