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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   2633 Views

Avatar
shox

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 http://doc.silverstripe.com/doku.php?id=recipes:simplesearch&s=view%20page. 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 http://doc.silverstripe.com/doku.php?id=tutorial:4-site-search 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.

Avatar
Fuzz10

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 SearchForm.ss 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 !

Avatar
shox

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.

Avatar
Cyl

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;}

Avatar
Willr

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