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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
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
You can just float the divs / inputs left within CSS. Each Form element has tons of excess code you can tap into!
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')
);