I am working on creating a form where users can input a list of 1-10 items. Subsequently, they will be prompted to provide an explanation (in a text box) for each item on the list. However, I am facing challenges in implementing this dynamically.
For a single question, I currently have:
<form id="myform">
<input id="choice1" type="text" name="item1" placeholder="" />
<input type="submit" name="submit" value="Next" />
</form>
If there were two items in the list:
<form id="myform">
<input id="choice1" type="text" name="item1" placeholder="" />
<input id="choice2" type="text" name="item2" placeholder="" />
<input type="submit" name="submit" value="Next" />
</form>
The follow-up question would be:
<h3 class="fs-subtitle">Explain why {listChoice1} is included in your list</h3>
<textarea id="explanation1" type="text" name="explanation1"></textarea>
<input type="submit" name="submit" class="submit action-button next" value="Next" />
I am looking for a way to allow users to easily expand the list size as needed and dynamically generate follow-up questions for each item on the list. Any suggestions on how to achieve this seamlessly?