2

is there any way to disable hook_field_validate when the corresponding field widget is disabled (via #disabled = true or #access = false) in corresponding form?

Or, alternatively, is there at least any way to retrieve information about the form that called the hook_field_validate? To be specific, is it possible to get the information whether the field widget was #disabled or had #access set on false?

I'd need to run my validations only when the corresponding field widget is actually editable in the form that called the validation. At the same time, I'd prefer something that is attached to a field rather than just a form.

I know I could alter the form, run check whether the field is 'disabled and access'able and then (if it's ok) attach my own validation... that would work but it would be form-specific which is something I'd rather not do.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.