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.

Archive

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

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

Invalid html - forms: getting rid of <span class="middleColumn">


Reply

7 Posts   1756 Views

Avatar
dio5

28 September 2007 at 9:24pm Community Member, 501 Posts

I noticed that when I generate a checkboxsetfield it creates invalid html.

The problem seems to be that an UL is put IN a SPAN, which is not allowed.
Any ways to get rid of this span element in there, or change it to a div maybe?

(without having to change a lot of core code?)

Avatar
dio5

28 September 2007 at 10:43pm Community Member, 501 Posts

Besides that I'm looking for a way to group certain fields in the form

I would have blocks with 'user details', 'topic categories', 'topic details', and 'topic map' all in one form. I know I can put a headerField to it, but I need a way to group these in a div or even a different fieldset, which would allow me to do more with css.

If anyone's still alive here, let me know.

Avatar
dio5

28 September 2007 at 11:59pm (Last edited: 29 September 2007 12:01am), Community Member, 501 Posts

Or, what will I break in the cms when I strip <span class="middleColumn"> from DefaultFieldHolder.ss?

Forget about that.. that doesn't seem to be the place to change it...

Avatar
dio5

29 September 2007 at 9:53pm Community Member, 501 Posts

So, grouping certain input fields in a extra div or having separate fieldsets is impossible I presume?

Avatar
dio5

30 September 2007 at 12:41am Community Member, 501 Posts

Looks like I found something that might work: CompositeField.

[url]http://doc.silverstripe.com/doku.php?id=compositefield[/url]

However this seems to be a bit over the top... it creates more divs than necessary.

$fieldgroup = new CompositeField(   new HeaderField("Details Auteur", 3),
                     new TextField("FirstName", "Voornaam", $member->FirstName),
                     new TextField("Surname", "Achternaam", $member->Surname),
                     new EmailField("Email", "Email", $member->Email)
                     );
$leftfield->setColumnCount(1);

This gives me a wrapper div <div class="field CompositeField nolabel multicolumn">
AND a new div per field:either <div class="column1"> or <div class="column1 lastcolumn">   .

I certainly don't need those extra divs. I only want the wrapper...

Avatar
Andy

1 October 2007 at 9:15am 230 Posts

A LiteralField lets you place HTML in your forms, you could use that.

Avatar
dio5

1 October 2007 at 8:28pm Community Member, 501 Posts

Great idea! One for the opening div and one for the closing..

Thanks!