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:

Form Questions /

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

How to take out 'Form Legend' tag

Go to End

16 Posts   4997 Views


Community Member, 501 Posts

28 January 2009 at 4:17am

To come back on your legend question:

you have to do it on the form, not on the fieldset.

So I guess in your case this would become:

instead of

return new SearchForm($this, "SearchForm", $fields, $actions); 


$form = new SearchForm($this, "SearchForm", $fields, $actions); 
$form->setLegend("My Legend");

return $form

Although I'm not sure which SS version you're using and if this was part of 2.2.3 already...


Community Member, 1 Post

29 January 2009 at 9:57am

Hi Ian,

if you just want to take out the "Form legend Tag", go to directory sapphire->templates, open the "" and delete it.

regards, Andi


Forum Moderator, 5523 Posts

29 January 2009 at 3:42pm

Edited: 29/01/2009 3:42pm

andi68, editing the sapphire/ templates is often a bad idea as when you are upgrading SS, its likely to break. As for getting rid of the legend you should just be able to do this in your CSS file

form legend {
 display: none;


Community Member, 6 Posts

1 March 2009 at 10:31am

Edited: 01/03/2009 10:32am

Copy from "sapphire/templates" into "mysite/templates" (or mytheme/templates). Then remove the "<legend>Search</legend>" tag. This way there are no issues in case of framework updates.


Community Member, 21 Posts

20 March 2009 at 4:48am

Thanks willr, your solution it works


Community Member, 55 Posts

1 May 2009 at 12:47pm

Thanks maksfeltrin, I think your solution is the best.

Willr - the CSS way does work, but I'm obsessive about my code validating with no errors and warnings.

Is that meaningless legend tag there for the future? :-)


Forum Moderator, 5523 Posts

1 May 2009 at 1:57pm

It shouldn't be meanless - it should have some text in it at some point. Maybe I will change this for 2.4. I didn't want to add it for 2.3 as it would likely break alot of sites.


Community Member, 55 Posts

1 May 2009 at 2:54pm

No worries Will, understood - I feel a little bad about being critical because overall SilverStripe is freakin' awesome!

Go to Top