[eluser]jpi[/eluser]
Hi,
From line 749 file form_helper.php
Code:
function set_radio($field = '', $value = '', $default = FALSE)
{
$OBJ =& _get_validation_object();
if ($OBJ === FALSE)
{
if ( ! isset($_POST[$field]))
{
if (count($_POST) === 0)
{
return ' checked="checked"';
}
return '';
}
$field = $_POST[$field];
if (is_array($field))
{
if ( ! in_array($value, $field))
{
return '';
}
}
else
{
if (($field == '' OR $value == '') OR ($field != $value))
{
return '';
}
}
return ' checked="checked"';
}
return $OBJ->set_radio($field, $value, $default);
}
Let's say I haven't initialized a form_validation object and have not yet submited the form that use set_radio() (so $_POST[] is empty). Then this function will return 'checked="checked"' whatever $default argument is.
I don't think it is the expected behavior.