17487 Posts in 4473 Topics by 1978 members
|Go to End|
31 May 2007 at 12:34pm Last edited: 31 May 2007 12:34pm
by adding a div tag to \silverstripe\sapphire\templates\SearchForm.ss
<% control Fields %>
<% end_control %>
<% control Actions %>
<% end_control %>
is this the right way to go about it? I am scared that when I do my next upgrade of SS, I will loose this tweak to sapphire.
What shall I do?
3 June 2007 at 4:09pm
Nicolaas, the form is already a block element and therefore the div inside the form is redundant. What are you trying to accomplish? This doesn't make it w3 compatible but just adds extra markup that is probably not needed.
4 June 2007 at 11:46am Last edited: 4 June 2007 11:47am
Perhaps what you're trying to do, instead, is add a <div> where a <fieldset> is probably required.
All <form> elements require a <fieldset> inside it to make it standards compliant. I guess this is something that was overlooked...
5 June 2007 at 12:22am
hmmmm, sounds like we have different ideas of compliance. When I check my xhtml with W3 then I get an error message if I do not have a <p> or a <div> in the form to hold the content, so I just add a <div> or a <p>. I agree though that <form> in itself should do the trick.
Fieldset is a relatively new thing as far as I understand it, but perhaps that is the ultimate answer.
5 June 2007 at 7:52pm Last edited: 5 June 2007 7:53pm
<fieldset> is a quite old HTML-standard, but not very frequently used. just putting some extra tags in your markup to make the validator shut up is not the right approach IMO ;-) our normal Form.ss already adds a <fieldset>, but this was missed in SearchForm.ss.
Sean has created an issue in our bugtracker for this a week ago, but it needs some investigation if this addition changes the layout of existing layouts (e.g. indentation or borders).
5 June 2007 at 10:23pm Last edited: 5 June 2007 10:27pm
<fieldset> still gives you the ability to place <legend> elements, a great usability feature. ;-)
It's doubtful you're going to need multiple fieldsets for SearchForm, but it's also nice to split up different sections of your form if it's for anything else. For example: 'Contact' fields would have it's own <fieldset> element, and a <legend> element too, so it labels that 'set' or 'group' of fields logically.
It really should be used, plus it also does give you more flexibility in styling forms with the extra element, like different background styles... ;-)
All forms created using SilverStripe include the <fieldset> element as Ingo said, and as such it was probably just 'forgotten' in the SearchForm. Either we leave it for 2.1 or we fix it in the 2.0.2 or 2.0.3 subsequent releases, and just add a note in the changeset that we've done this for validation reasons, and W3C compliance which is important.
28 September 2007 at 11:01pm Last edited: 28 September 2007 11:01pm
Any news on this yet?
Having multiple fieldsets in some forms is truly a must. Now every form seems to have only one fixed fieldset by default (?) while in a lot of cases you really want to group different sections in different fiedsets. If there is a way to do it, I would appreciate it a lot if someone told me.
Having the option to add a legend would be great too.
1 January 2008 at 5:01am
You could put that modified copy of "SearchForm.ss" into /silverstripe/yousite/templates/SearchFrom.ss
This would prevent the overwriting at next upgrade ...
|Go to Top|