Bulk Reset of Input Fields within Container Box

Is it possible to do a reset of all input fields within a container box without having to do it for each individual input field?

I am creating a multi-step form for registration of a family, so different steps for adding adults and children, etc. Within the step for registering adult information, it’s initially mandatory to enter the information for one adult. There are a total of 26 possible input fields (including some conditional fields), and I have them within a container box to keep them all together (#boxAdult1). If there is more than one adult in the family, the submitter can click “Add Another Adult” (#buttonAddAdult) which shows another container (#boxAdult2) with all the same fields (26 total possible input fields) for a second adult. I have a “Delete 2nd Adult” button (#buttonDeleteAdult) that the submitter can click to hide/collapse the second adult container box if they change their mind and don’t want to enter a 2nd adult’s information. When the #buttonDeleteAdult is clicked, any input in #boxAdult2 is cleared and the container box is hidden/collapsed. Is it possible to do a single clear/reset of every input field within #boxAdult2 or am I stuck doing it for every individual input field?

Here’s the code I have right now, with it set to clear the value of 3 of my 26 input fields as an example:

$w.onReady(()=>{
$w(‘#buttonAddAdult’).onClick(()=>{
$w(“#boxAdult2”).show()
$w(‘#boxAdult2’).expand()
$w(‘#buttonAddAdult’).hide()
$w(‘#buttonDeleteAdult’).show()
$w(‘#buttonDeleteAdult’).enable();
});
$w(‘#buttonDeleteAdult’).onClick(()=>{
$w(‘#a2FN’).value = “”;
$w(‘#a2MN’).value = “”;
$w(‘#a2LN’).value = “”;
$w(“#boxAdult2”).hide();
$w(‘#boxAdult2’).collapse();
$w(‘#buttonAddAdult’).show();
$w(‘#buttonDeleteAdult’).hide();
});
});

Try $w(‘#a2FN, #a2MN, #a2LN’).value = “”;

You could also try writing a function with the boxName as parameter, inside that function get all its children, filter them for everything that starts with an “a” and then in a loop setting those values to “”.
Have not done it, but think it should work. It would be a cleaner solution.