ZF-3339: DtDdWrapper is not xhtml valid for radio buttons


The empty definition term which is placed using Zend_Form when radio buttons are being generated is not XHTML valid. Therefore I suggest that, if the doctype is set to XHTML, the wrapper either doesn't place the empty definition term

, or places a nonbraking space inside it  . This has been fixed if no label is set ( but appearantly radio buttons use different 'label generation' by default. I think this is also the case with checkboxes.


Can you post a small reproduce case to clearly show this behavior, please?

$radio = new Zend_Form_Element_Radio('radio'); $radio->addMultiOptions(array('radio_1'=>'Radio 1', 'radio_2'=>'Radio 2', 'radio_3'=>'Radio 3')); $form->addElements(array($radio));

without any decorators etc. the above php code will output the following html (I also don't understand why the style="white-space: nowrap;" is being generated by default, but that's another issue perhaps):

Radio 1Radio 2Radio 3

instead, it should output

  because an empty isn't xhtml valid.

Confirmed; scheduling for next mini release.

Actually, funny thing about this one is that it's actually an issue with the Label decorator; if a tag is provided as an option, but no label, it simply spits out the tag with no content. I'm updating to have it provide a no-break space for content.

Fixed in trunk and 1.5 and 1.6 release branches.

The situation described is not invalid XHTML, and the non-breaking space should be removed.

Robin, the markup did not validate, plain and simple. After the changes, it does. Re-closing.

Closing as duplicate of Parent Issue.