Silverstripe Version: 3.6
Question:
I have problem with submiting form. When i submit form method was not executed in all page types.
I test code from documentation with HelloWorld and again doHelloWorld not executed.
I waste 2 days on this problem and realy dont know what can be problem and whay method was not executed on submit button.
Here is my controller:
This code is form: https://docs.silverstripe.org/en/3/developer_guides/forms/introduction/
class ContactPage_Controller extends Page_Controller
{
private static $allowed_actions = array(
'HelloForm'
);
public function init()
{
parent::init(); // TODO: Change the autogenerated stub
}
public function HelloForm() {
$fields = new FieldList(
TextField::create('Name', 'Your Name')
);
$actions = new FieldList(
FormAction::create("doSayHello")->setTitle("Say hello")
);
$required = new RequiredFields('Name');
$form = new Form($this, 'HelloForm', $fields, $actions, $required);
return $form;
}
public function doSayHello($data, Form $form) {
return $this->redirect("/");
}
}
This is my code also not working:
Also i try module Userforms and that also not working.
Before 5 days i create one form on HomePage and worked good, but when i create new Page type and create new contact form all start bugging. Anyone can help me and explain me what is happening here. I’m starting to crazy