Instead of on form submit validation triggering on "add another item" of multivalue field collection item.

Setup

Field Collection item
-------Item --Entityreference Field
-------Specs -- Textfield

configuration: multivalue, unlimited

validation applied:Number of selections on field collection item with min 3 and max to 10.

When selecting first ER field and filling specs textfield when "add another item" is clicked then configured error message is showing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

g089h515r806’s picture

"add another item" , means http request by ajax,

firfin’s picture

Unfortunately this makes this module (or at least the 'Number of selections' validator) unusable with field collection. There is no way to reach the minimum number of values because the validation stops the adding of items. A shame really, I have seen many issues calling for a minimum ( or maximum or range) number of values.

joelpittet’s picture

Version: 7.x-2.4 » 7.x-2.x-dev

Same problem as #2 describes.

sassafrass’s picture

I have a required field where the user can (add another) an "unlimited" number of times. Upon creation of the entity, this works as expected. However, each time the entity is edited, validation "requires" me to enter another value even if one already exists.

sassafrass’s picture

I have added a patch that limits "Required" to the first of a field with multiple or unlimited cardinality. Please review and let me know if it works for your use case(s).