Skip to content

Commit

Permalink
handle check box case
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Apr 12, 2024
1 parent b864632 commit 79fa3ed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/forms/waitlist-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ <h3 class="usa-alert__heading">Error</h3>
const diseaseInterest = [];
fieldsToCheck.forEach(
(element) => {
if (element.type === "checkbox" && element.name.includes("interested in")){
if (element.checked) {
if (element.type === "checkbox"){
if (element.name.includes("interested in") && element.checked) {
diseaseInterest.push(element.value);
}
else{
data[element.name] = element.checked;
}
}
else {
data[element.name] = element.value;
Expand Down

0 comments on commit 79fa3ed

Please sign in to comment.