Hi there,
Is there a way to send form data to an external URL after the form has been returned? setFormAction only works before.
public function PayForm() {
$fields = new FieldList(
TextField::create('USER1', 'Name and Surname'),
TextField::create('EMAIL', 'Email')
);
$actions = new FieldList(
FormAction::create("doPayment")->setTitle("Pay Now")
);
$required = new RequiredFields('Name');
$form = new Form($this, 'PayForm', $fields, $actions, $required);
$form->setFormMethod('GET');
return $form;
}
public function doPayment($data, Form $form) {
$data['CHECKSUM'] = md5($data['NAME'].$data['SURNAME']);
$form = new Form($this, 'doPayment', $fields, $actions, $required);
//Send data to URL here
}
}