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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

Form Submission in OnePage Site

Go to End

2 Posts   915 Views


Community Member, 1 Post

24 August 2014 at 10:11pm

Edited: 25/08/2014 4:36am

I am using silverstripe to create a OnePage Website - all pages are rendered by one main page to create a scrollable website.
So far the site works very well (, however now I need a contact form.
The problem is, due to letting one page render all forms (
<% loop AllChildren %>
<% end_loop%>
I cannot use the page controllers.
Rendering the form works by just adding the ContactForm method to the page class that should render the form.
However, I do not know where I should add the submit method - I tried adding it in the custom form class but that did not work. Can anyone help me?

Thanks in advance!

Daniel Eder

EDIT: I solved the problem by adding the form to the page holder class and moving it to the right position using javascript.


Forum Moderator, 5523 Posts

28 August 2014 at 9:41pm

The submit method is able to go into the Form class. You just need to make sure it's an allowed action on the form. Form submission handler will check that it matches a method on your controller, a method in your form then a method on one of your fields.