1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 185 Views |
-
Augmenting Validation on Subclassed Custom Forms

19 February 2013 at 3:09am
I have a cusrtom form, with multiple subclasses forms that I want to augment the Validation porion on the sublcasses, but I'm not sure how to go about it.
The Custom Form
class LeadCaptureForm extends Form {
public function __construct($controller, $name) {$fields = new FieldList(
$holder
);
$actions = new FieldList(
FormAction::create("leadSubmit")->setTitle($controller->FormButton)->setUseButtonTag(true)->addExtraClass('button red small point-right')
);
$validation = new RequiredFields(array('Email'));
parent::__construct($controller, $name, $fields, $actions, $validation);
}The sublcassed forms look like this
class MarketForm extends LeadCaptureForm {
function __construct($controller, $name) {
parent::__construct($controller, $name);$newfields = new CompositeField(
$house,
$homedeet,
$propDeets
);
$this->Fields()->insertBefore($newfields, "main");
}
}On the MarketForm I'd like to add a few of the LeadCaptureForms to the validation as well as the the fields from MarketForm.
| 185 Views | ||
|
Page:
1
|
Go to Top |

