Bug Tracker

Modify

Ticket #4213 (closed enhancement: worksforme)

Opened 4 years ago

Last modified 4 years ago

[validate] Allow for the ability to add groups

Reported by: cfjedimaster Owned by: joern
Priority: minor Milestone: 1.4
Component: plugin Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

Currently you can only group fields when you initialize the validate constructor. In a form where items are added dynamically, it would be nice to have the ability to add groups dynamically as well. For example, I like to group firstname and lastname fields. My form allows me to add N people. I want to group each new set into one group so I can have one error message per 'set' of fields.

Change History

comment:1 Changed 4 years ago by joern

  • need changed from Review to Test Case
  • Owner set to joern
  • Component changed from unfilled to plugin

comment:2 Changed 4 years ago by joern

  • Status changed from new to closed
  • Resolution set to worksforme

Considering that each field has to have a unique name, you should be able to generate enough groups up front. Something like this:

// max 100
var groups = {};
for(var i = 0; i < 100; i++) {
  groups["group" + i] = "firstname" + i + " lastname" + i ;
}

That generates 100 groups, assuming group names of group0, group1 etc. and values of "firstname0 lastname0", "firstname1 lastname1" etc.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.