Let’s make an impact. You can give a one-time or recurring gift.
Thank You!
Thank you for your support.
You will receive an e-mail confirmation of your gift shortly.
Thank You!
Thank you for your support.
You will receive an e-mail confirmation of your gift shortly.
${dropdownOptions.join('')}
`;
return newRow;
}
document.getElementsByClassName("comments-holder")[0].prepend(createNewDropdownRow('1')); // the comments group in One-Time
document.getElementsByClassName("comments-holder")[1].prepend(createNewDropdownRow('2')); // the comments group in Recurring
/* Ensure textarea is repopulated before submit */
const submitBtn1 = document.querySelectorAll('input[type="submit"]')[0];
submitBtn1.addEventListener("click", () => {
// check if text area contains a valid option
const comment1 = document.querySelectorAll(".comments-holder textarea")[0]; // target the comment box
const dropdown1 = document.getElementById("role-select-1");
prependToComment(comment1, dropdown1.value);
});
const submitBtn2 = document.querySelectorAll('input[type="submit"]')[1];
submitBtn2.addEventListener("click", () => {
// check if text area contains a valid option
const comment2 = document.querySelectorAll(".comments-holder textarea")[1]; // target the comment box
const dropdown2 = document.getElementById("role-select-2");
prependToComment(comment2, dropdown2.value);
});
})();