I have a multiple step form. To validate each step I thought it might be handy to create a JSON object, Where each key acts as a step with the right fields.
My object is not finished, but looks now like this:
let validationSteps = {
0: {
location: null,
duration: null,
membershipType: null,
},
1: {
fname: null,
}
};
I want to fill each item by using an event listener. For example, when you fill in your first name. It should trigger something that searches for fname in the object, and fills it. But I have no clue how to find the key, since it's already inside an object.