Hi. I get errors
//messages for field type1
Type1 is required.
Type1 InclusionIn.
//messages for field type2
Type2 is required
Type2 InclusionIn
Here is my code
$type1 = new Radio("type1");
$type1->setAttributes(array(
'required' => true,
'autocomplete' => 'off',
'checked' => 'checked',
'name' => 'type',
'value' => 1
));
$type1->setFilters(array('int'));
$type1->addValidators(array(
new PresenceOf(array(
'message' => 'Type1 is required'
)),
new InclusionIn(array(
'message' => 'Type1 InclusionIn',
'domain' => array(
1,2
)
)),
));
$this->add($type1);
$type2 = new Radio("type2");
$type2->setAttributes(array(
'required' => true,
'autocomplete' => 'off',
'name' => 'type',
'value' => 2
));
$type2->setFilters(array('int'));
$type2->addValidators(array(
new PresenceOf(array(
'message' => 'Type2 is required'
)),
new InclusionIn(array(
'message' => 'Type2 InclusionIn',
'domain' => array(
1,2
)
)),
));
$this->add($type2);