I have a couple of input fields, the number of input fields vary based on a user entered input field. If the user enters 1 then 20 text fields and 20 emails display, if they enter 2 then 40 text fields and 40 email fields display and so on. On submission of the form I need these fields to be added to the textarea field separated by a comma. It is similar to what was done here: Re-posting <input> value into <textarea> but due to the large number of possible fields I can't add each input as a variable. Is there an efficient way to do this considering there could be so many fields? TIA.
<div id="sponsor">
<input type="text">
<input type="email">
</div>
<textarea></textarea>