It looks like you're new here. If you want to get involved, click one of these buttons!
function on_before_validate($values)
{
$values['slug'] = url_title($values['name'], 'dash', TRUE);
$posted = $_POST;
$this->get_validation()->add_rule('icon', 'my_custom_validation', 'Where is your icon?', $posted['icon']);
return $values;
}
Comments
Also I have a field that is of type file which has been added to my 'required' array, but the required class is not being applied to the label.
With regards to making it have the asterisk for a required field, you can specify it in your form_fields method instead like so:
$fields['icon']['required'] = TRUE
Is the field you want required a field in the table?