[eluser]fesweb[/eluser]
set_radio is not intended to return the value of the radio button, it is intended to return the radio button's state.
Try it like this instead, using a boolean test as the third parameter:
Code:
$radio_state = set_radio('my_field', 'car', $my_field == 'car');
$data = array(
'name' => 'my_field',
'value' => 'car',
'checked' => $radio_state
);
echo form_radio($data);
Without the form_radio function it would look like this:
Code:
<input type="radio" name="my_field" value="house"<?php echo set_radio('my_field', 'house', $my_field == 'house'); ?>>
<input type="radio" name="my_field" value="car"<?php echo set_radio('my_field', 'car', $my_field == 'car'); ?>>