[eluser]JulianM[/eluser]
Thanks, I think this is a good approach, but still thinking that this code could be placed in a helper to avoid duplicating the logic each time.
Code:
(1 == $member->active) ? set_radio('active', $member->active, TRUE) : set_radio('active', '1'))
What do you think?
Julian
[quote author="Nexus Rex" date="1262761831"]
Brilliant!
I used your method for two radio boxes:
Code:
<?php echo form_radio('active', '1', FALSE, (1 == $member->active) ? set_radio('active', $member->active, TRUE) : set_radio('active', '1')); ?> <label for="active">Active</label>
<?php echo form_radio('active', '0', FALSE, (0 == $member->active) ? set_radio('active', $member->active, TRUE) : set_radio('active', '0')); ?> <label for="active">Inactive</label>
[/quote]