Hi there,

I add an radio element like this:

$form->add(.... some fieldelement ....)
->add(.... some fieldelement ....)
->add(array(
'name' => 'icons-pixiebox',
'type' => 'Zend\Form\Element\Radio',
'attributes' => array(
'type' => 'radio',
),
'options' => array(
'label' => 'Icoon Pixiebox',
'value_options' =>array('value1' => 'value1', 'value2' => 'value2'),
),
));

It's not required, so it's allowed to be empty when nothing is chosen.
But when I do:

$form->setData($formData);
if ($form->isValid($formData)) {

.... it's never valid.... I removed the radio element and it was valid
again...




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-from-radio-elements-not-valid-unless-value-give-tp4660969.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to