Remove empty LEGEND tags in Silverstripe search form

David Nash silverstripe, xhtml 3 Comments

I’m pretty obsessive about my HTML validating with no errors and no warnings. It bugs me that when I use Silverstripe’s incredibly convenient $Searchform in the template that it outputs an empty legend tag inside the fieldset. There’s an easy way to fix this: Create a templates directory inside mysite. Copy sapphire/templates/SearchForm.ss to mysite/templates/SearchForm.ss Edit your copy of the file and remove that pesky <legend></legend> line Refresh your page that uses the searchform and bathe in the warm glow of a error and warning free page! Thanks to Maksfeltrin in the Silverstripe forums for pointing this out.