I have a form with default values set, e.g.:
<input type="text" id="mail" name="mail" value="<?php echo set_value('mail', '[email protected]'); ?>" />
I validate the form using Codeigniter's form_validation class. For this field:
$config = array(
array(
'field' => 'user',
'label' => 'Naam',
'rules' => 'trim|required|valid_email'
));
Here's my problem. When the user leaves the field untouched and submits it's default value '[email protected]', I want to reject this value. I know I can use a callback, but that would mean I have to write a callback for every field of the form. Not nice!
I've looked into the validation rules. 'differs' looked promising, but it only checks whether one field is different from another field.
Now what's the best way to deal with default values in Codeigniter?