1792 Posts in 588 Topics by 560 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 281 Views |
-
Form creating, submit action problem

19 July 2012 at 8:43pm
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
}
| 281 Views | ||
|
Page:
1
|
Go to Top |

