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

Avatar
dio5

Community Member, 501 Posts

28 September 2007 at 9:24pm

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

Community Member, 501 Posts

28 September 2007 at 10:43pm

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

Community Member, 501 Posts

28 September 2007 at 11:59pm

Edited: 29/09/2007 12:01am

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

Community Member, 501 Posts

29 September 2007 at 9:53pm

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

Avatar
dio5

Community Member, 501 Posts

30 September 2007 at 12:41am

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

230 Posts

1 October 2007 at 9:15am

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

Avatar
dio5

Community Member, 501 Posts

1 October 2007 at 8:28pm

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

Thanks!