Creating this kind of form is slightly more complex than your normal form since the number of fields to validate isn't known beforehand. Still, that would be better and should be done as a next step.