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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Form Field Position


Go to End


3 Posts   2564 Views

Avatar
Mohan

Community Member, 19 Posts

4 June 2008 at 10:01pm

Edited: 04/06/2008 10:01pm

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

Avatar
Willr

Forum Moderator, 5523 Posts

13 June 2008 at 5:10pm

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

Avatar
Sean

Forum Moderator, 922 Posts

15 July 2008 at 6:29pm

Edited: 15/07/2008 6:29pm

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')
);