Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Invalid html - forms: getting rid of <span class="middleColumn">

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

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

Page: 1
Go to End
Author Topic: 1729 Views
  • dio5
    Avatar
    Community Member
    501 Posts

    Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

    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?)

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

    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.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

    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...

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

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

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

    Looks like I found something that might work: CompositeField.

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

    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...

  • Andy
    Avatar
    230 Posts

    Re: Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

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

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Invalid html - forms: getting rid of <span class="middleColumn"> Link to this post

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

    Thanks!

    1729 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.