Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

How to remove the <legend>Search</legend> when using simplesearch

Go to End

5 Posts   2251 Views


Community Member, 21 Posts

12 November 2008 at 2:15pm

Hello Everyone. I am developing a site and im stuck with a problem.
I used the simplesearch function found here Everything worked but i ran into a problem. In the design, im getting a <legend>Search</legend> tag, which is pretty much messing the design. I tried using the search from the tutorial found here but that one also showed the legend tag.
Is there any way to remove it, or at least hide it?

Thanks in advance.
Harry A.


Community Member, 791 Posts

12 November 2008 at 9:20pm

Welcome to Silverstripe Harry...

The Legend appeared all of a sudden in version 2.2.3 for me too. I have no idea why this is.
But the easiest way to change this is to copy the from /sapphire/templates to your own templates dir and edit it ....

Silverstripe will then automatically use this template-snippet to create the simplesearch form.

Good luck !


Community Member, 21 Posts

12 November 2008 at 11:53pm

Thanks for the welcoming. Its great to be here.

Thanks for the tip as well. it worked ofc.

By far one of the best CMS systems ever.


Community Member, 2 Posts

24 November 2008 at 3:57pm

easier way would have been to modify the form CSS in themes/<name of your theme>/css/form.css and add the following:

#id_name_used_by_your_form legend { display:none;}


Forum Moderator, 5523 Posts

24 November 2008 at 6:05pm

The legend is a required tag for HTML strict validation (or WCAG) if I am not mistaken. I think I added that to the core template as part of a project to make it compatible. You can just hide it like Cyl has mentioned in the CSS file