Hi
I have problem with form. Submit action doesn't work:
FormIndex.php
class FormIndex extends Form {
function __construct($controller, $name) {
$fields = new FieldSet(
new TextField('FirstName', 'First Name'),
new TextField('Tel', 'Tel'),
new EmailField('Email', 'Email'),
new TextareaField('Frage', 'Frage')
);
$actions = new FieldSet(
new FormAction('doForm', 'Submit')
);
parent::__construct($controller, $name, $fields, $actions);
}
function doForm($data, $form) {
print_r($data);
exit;
// do procedures after form is submitted here
}
}
Start.php
class Start_Controller extends StaticPage_Controller {
public static $allowed_actions = array(
'doForm'
);
public function formularz(){
$form = new FormIndex($this,'FormIndex');
$form->setFormAction($this->link('doForm'));
return $form;
}
}
nothing happens, after submit form site is redirecting to /home/doForm but this action doesn't work
function doForm($data, $form) {
print_r($data);
exit;
// do procedures after form is submitted here
}