We have a special date field that we set upon user creation when our custom user form is submitted. The user does not have to set this field themselves.
We have a separate form, which is a user edit form. We build this form using a
form_alter() hook that looks for the default user register form.
For some reason, even though this special date field is hidden on this form, validation runs against it as if the form has been submitted with a blank value, and we get the error (on the frontend of the form)
There are errors in verification code created on value #1: The dates are invalid.
I found a way that "works" to get around this,
$form["field_special_field_created_"]['und']['#element_validate'] = '';
But I think that this is pretty ugly. Why only this field? why can't this field retain its original value?
Since this special field date needs to stay the same, I need to find a way to make it work like the other fields do.