I have a dropdown field in my form and when I hit submit the form goes through validation and if an error happens, return all the value. This work expect for my dropdown meu
CodeIgniter has set_checkbox() and set_radio() that you need to use instead of set_value()
But set_checkbox and set_radio have some issues, and don't seem to be able to handle forms that are designed to handle BOTH create AND update forms.
This is the fix. You can put this code in a helper or extend the form_validation class.
$field))
{
// does it match the value we provided?
if ($defaults->$field == $value)
{
// yes, so set the checkbox
echo "checked='checked'"; // valid for both checkboxes and radio buttons
}
}
}
?>