[eluser]MathBoon[/eluser]
Hey Warz,
it's a little late, but i have/had the same problem and after looking at the helper-function form_radio(), i found a really easy way to combine those two:
Code:
form_radio($name,$value,$checkedOrNot,set_radio($name,$value));
The fourth parameter is called "extra" and it's only being added to the returned html, and since set_radio only returns "checked='checked'" OR nothing, it fits perfectly.
Still, if you use an array with form_radio like this:
Code:
$data = array("name" => $name, "value" => $value);
form_radio($data);
then you'll probably need to use it like this, because the function doesn't catch any "extra" field of an array:
Code:
$data = array("name" => $name, "value" => $value);
form_radio($data,$value,$checkedOrNot,set_radio($name,$value);
It'd be nice if they could built in a catch for an attribute like "PureHTML", which could by used just like the "extra" parameter.