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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

redirect thanks page create Problem

Go to End

2 Posts   1708 Views


Community Member, 57 Posts

17 June 2009 at 2:10am

Edited: 17/06/2009 12:30pm

when i redirect to thanks page then

msg :

Sorry, it seems you were trying to access a page that doesn't exist.

Please check the spelling of the URL you were trying to access and try again.

so, created a thanks page "http://localhost/SilverStripe-v2.3.1/thanks/" then page redirect well but problem is that i created by admin content page so this page also show when we navigate a this site so please help me without navigation show create a thanks page................

me code is :

class RegistrationForm extends Page {


class MyObject extends DataObject {
static $db = array(
'Typeofenquiry' => "Enum('Please select,Business Development,Hall Hire,Events,Membership,Accounts,Library & Archives,General','Please select')"

class RegistrationForm_Controller extends Page_Controller {

// Make sure you set this to the right group.
// See
private $defaultGroupID = 2;

* This function lets you put a form on your page, using $Form.

function Form() {
return new Form($this, "Form", new FieldSet(

// List your fields here
new TextField("Name", "name"),
new TextField("JobTitle","Job title"),
new TextField("CompanyName","Company name"),
new TextField("Address","Address"),
new TextField("Post code","Post code"),
new TextField("Telephone","Telephone"),
new TextField("Mobile","Mobile"),
new EmailField("Email", "Email"),
new TextField("Enquiry","Enquiry"),
new TextField("TypeOfFunction","Type of function"),
new TextField("NumbersAttending","Numbers attending"),
new TextField("PreferedDates","Prefered dates"),
new DropdownField('Typeofenquiry',
'Type of enquiry',

), new FieldSet(

// List the action buttons here
new FormAction("SignupAction", "Sign up")

), new RequiredFields(
"Email", "Name","Enquiry","Telephone"

// List the required fields here: "Email", "FirstName"

$field = new DropdownField(

* This function is called when the user submits the form.
function SignupAction($data, $form) {

// Create a new Member object and load the form data into it
$member = new Member();

// Write it to the database. This needs to happen before we add it to a group

// Add the member to group. (Check if it exists first)
if($group = DataObject::get_one('Group', "ID = $this->defaultGroupID")) {

// Redirect to a page thanking people for registering


// Redirect to a failure page





Community Member, 219 Posts

11 June 2011 at 4:07am

well to hide the page from navigation, you just use the checkbox under the "behaviour" tab to remove it from site search and site nav.

also, this may come in handy for anybody who wants to easily include forms in a sidebar or any other area of the site, without controlling a hidden page:

it also has an easy "query database for existing member" function that isn't covered in the form tutorials...