Hi there,
I have a form that is supposed to post data to an external url and it does...but for some reason form validation does not work. If i add the domyform function in, the form does validate, but it does not post to the external url.
function myform() {
$fields = new FieldSet(
new TextField('name_first','First Name'),
new TextField('name_last','Last Name'),
new EmailField('email_address','Email Address')
);
// Create actions
$validator = new RequiredFields('name_first', 'name_last','email_address');
$actions = new FieldSet(
new FormAction('domyform', 'Pay Now')
);
$form = new Form($this, 'myform', $fields, $actions, $validator);
$form->setFormAction('http://www.blah.com');
return $form;
/////this works, but validation fails
}
the following validates...but does not post to external url
function myform() {
$fields = new FieldSet(
new TextField('name_first','First Name'),
new TextField('name_last','Last Name'),
new EmailField('email_address','Email Address')
);
// Create actions
$validator = new RequiredFields('name_first', 'name_last','email_address');
$actions = new FieldSet(
new FormAction('domyform', 'Pay Now')
);
$form = new Form($this, 'myform', $fields, $actions, $validator);
$form->setFormAction('http://www.blah.com');
return $form;
}
function domyform($data,$form) {
return $form;
}