Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Form Field Position

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: 1963 Views
  • Mohan
    Avatar
    Community Member
    19 Posts

    Form Field Position Link to this post

    Hi all,

    I have two form fields and want to position the fields horizontally instead vertically
    which is by default.
    Can anyone tell me how to do it?

    example
    form field1 form field2

    Thanks in advance

    Mohan

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Form Field Position Link to this post

    You can just float the divs / inputs left within CSS. Each Form element has tons of excess code you can tap into!

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Form Field Position Link to this post

    Alternatively, you can wrap the elements in the FieldGroup object, which doesn't wrap each element with a container div, so the elements fall inline to eachother.

    For example:

    new FieldGroup(
       new TextField('Name'),
       new EmailField('Email')
    );

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