Trying to get this radiogroup to look nice in jQuery Mobile.
<div id="5066549580791808" class="ui-dform-radiobuttons">
<div class="ui-radio">
<input type="radio" class="ui-dform-radio" value="test1" name="5066549580791808">
</div>
<label class="ui-dform-label">Test1</label>
<div class="ui-radio">
<input type="radio" class="ui-dform-radio" value="test2" name="5066549580791808">
</div>
<label class="ui-dform-label">Test2</label>
</div>
And I would like it to turn out to:
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<legend>
Important question
</legend>
<input id="radio10" name="test1" value="1" type="radio">
<label for="radio10">
Test1
</label>
<input id="radio11" name="test" value="2" type="radio">
<label for="radio11">
Test2
</label>
</fieldset>
</div>
My first problem is that when I try to do something akin to what you suggest earlier,
$.dform.addType('radiobuttons', function(options) {
return $(this).wrap('<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">').parent();
});
$.dform.addType('radiobuttons', function(options) {
return $(this).wrap('<div data-role="fieldcontain">').parent();
});
These two end wrapping around each before the radio-group even starts. So how can I get the end tags </fieldset> and </div> to come after the radio group?
Second question, dForm automatically adds a <div class="ui-radio"> around every radio element. Is it possible to get rid of this somehow? I've poked around in the dForm source but haven't found a way to do so.
Any input towards this would be greatly appreciated.