0

In my form I have some fields, that should be validated depending on some field(-s) in another sub-fieldset of the Form:

MyForm
- [fieldset] main instanceof WhatEverFieldset
-- [fieldset] foo instanceof FooFieldset
--- [field] field_a
--- [field] field_b
-- [fieldset] bar instanceof BarFieldset
--- [field] field_c
--- [fieldset] xyz instanceof XyzFieldset
---- [field] field_d
-- [fieldset] buz instanceof BuzFieldset
---- [field] field_e
--- [fieldset] xyz instanceof XyzFieldset
---- [field] field_d

So there are some validation rules to implement, that effect the fields of multiple fieldsets. E.g.:

  • At least form.main.*.xyz.field_d has to be set. That means, I cannot define a required rule directly in the XyzFieldset, since there is a a condition and it for it's located outside of the XyzFieldset.

  • The value of form.main.foo.field_a has to be grater than the value of form.main.bar.field_c.

Where / How to define validation rules, that depend on fields' values of other sub-fieldsets of the form?

automatix
  • 14,018
  • 26
  • 105
  • 230
  • What you are talking about isn't simply form input validation. It's a functionnal validation that answers functionnal needs. Those kind of validation should be processed after input validation, with a custom validator / a validation service / whatever you want. – Unex Aug 23 '16 at 12:54
  • @Unex OK, but how to integrate it into the form? – automatix Aug 31 '16 at 07:31

0 Answers0