When a value is selected from a drop-down menu in the range of 1-10, the system displays a corresponding number of rows (N = value of dropdown).
Each row represents an object with three properties: x, y, z. All the created rows are stored in an array, resulting in the final data format:
data:{
rows: [
{x:0, y:0, z:value},
.......
]
}
It is necessary to ensure that, for each row, the values of x, y, and z do not exceed 100. If they do, an error should be displayed.
Attempts have been made to achieve this using a function that checks the array on each input change, but this method appears to be inefficient and unreliable.
What is the best way to handle this validation for dynamically generated inputs?
Thank you for your assistance!