Add lunch options
Change-Id: Ic4569fce73d8b33f5084e95d44797cba735914d5
diff --git a/static/main.js b/static/main.js
index 0f0025e..62ccf4e 100644
--- a/static/main.js
+++ b/static/main.js
@@ -31,6 +31,12 @@
if ($('#conference_dinner').is(":checked")) {
costs += parseInt($("#conference_dinner_price").text(), 10);
}
+ const lunches = ["lunch_day_1", "lunch_day_2", "lunch_day_3"];
+ lunches.forEach(function(lunch) {
+ if ($("input[name='" + lunch + "']:checked").val() != "--") {
+ costs += parseInt($("#lunch_costs").text().replace(/[^0-9]/g, ''), 10) / 100;
+ }
+ });
}
$("#total_due").val(costs.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }));
}