I have a pretty complex form with several nested Fieldset
s and Collection
s. Some parts of the form are constant, other parts are variable:
BasicSettings EndpointBasicSource (constant part) EndpointBasicTarget (constant part) SpecificSettings EndpointType{TYPE}Source (variable part) EndpointType{TYPE}Target (variable part)
The EndpointBasicSource
and EndpointBasicTarget
contain a ServerFieldset
, that provides the Field
server_name
. That means: The form contains at least 2
server_name
Field
s.
In the SpecificSettings
depending on the EndpintType
no, one, or both sides can contain a servers Collection
(options.target_element.type => ServerFieldset
) with up to 5
servers in it.
Here is a strongly simplified schema:
Now the servers should get unique (in all the server_name
fields in the form a value may not recur). But how to do this? The problem is, that the ServerFieldset
is injected via multiple other Fieldset
s/Collection
s and the uniqueness validation needs to relate to the server_name
Field
s in all of them.
How can this problem be solved and a uniqueness validation for all the server_name
in the entire form implemented?