I am currently developing an admin interface where users have the ability to add a specified number of cells. Each cell contains details such as name, imageURL, and destination link.
- name
- imageURL
- destination link
Users can add cells in bulk (starting with 8 but up to 20 at once) or individually.
The challenge I am facing is validating each field to ensure they are properly filled out. My initial plan was to use Angular form validation for this process. However, a requirement states that if a user has a certain number of items but only fills in half of them (leaving an entire cell empty), that cell should be disregarded entirely.
The issue arises when there are already 10 cells loaded - the form (containing all cells) is considered pristine/invalid. Once I fill in all 10 items, the form becomes dirty/valid. Adding 5 more cells makes the form dirty/invalid. Even after filling out 2 of those new cells, the form remains dirty/invalid when ideally it should be dirty/valid.
Any insights on how to address this situation?
View example plunkr: http://plnkr.co/edit/qwObH5LnxLvgJydJlJVS?p=preview
Extra credit if a solution can be implemented without using a form tag.