The default decorator for the Zend_Form_Element_Radio is
Probably my best idea so far, is to change the ZF [Zend Framework] HTML code from within jQuery, so that it gets compatible with jQuery UI format.
Here is the solution:
in ZF Form construction:
$this->setElementDecorators(array(
'ViewHelper',
'Errors',
array(array('rowElement'=>'HtmlTag'), array('tag'=>'div', 'class'=>'element')),
array('Label', array('class'=>'first')),
));
The important thing here is the div with class=element that will wrap all inputs [so that it is easy to get to them in jQuery]
And here is the JS code:
$(function() {
$( "div.element > label" ).each(function() {
$('input', this).after('');
$('label', this).text($(this).text());
var input = $('input', this).detach();
var label = $('label', this).detach();
var parent = $(this).parent();
$(this).remove();
input.appendTo(parent);
label.appendTo(parent);
});
$( "div.element" ).buttonset();
});