Would anyone be willing to offer some advice on the below code? I’m trying to achieve when all relevant fields have a value then it will perform a function, I had some previous code prior it but was very long as I have 7 boxes each for 8 participants.
export function participantsContinue_click(event) {
let participantNmb = $w('#participants').value;
for (let i = 1; i <= participantNmb; i++)
if ($w(`#name${i}`).value && $w(`#contactNumb${i}`).value)(console.log("Variable value " + i + " " + "Dropdown value " + participantNmb))
}
So the code works but a flaw is that if at least the first name and contact number are valid then it will perform the function because it has a value, I need it to make sure it has all of the relevant values to match the dropdown value. I played with many varieties for the past 4 hours but no dice.
Thank you!