Hi,
I’ve created a form with many checkboxes, and after following the thread posted by Naama (answered by Yisrael) this is what my code looks like. However, something is wrong/missing as the email notification does not include anything after the let comma = “”; command.
The website: https://anatbelinson.wixsite.com/inflatafunvi-new
The page: Booking
Any help will be appreciated. Here is the code and the email notification:
import {sendEmail, sendEmailWithRecipient} from ‘backend/email’;
$w.onReady(function () {
$w(“#dataset1”).onAfterSave(sendFormData);
});
function sendFormData() {
const subject = Booking Details with InflatafunVI for ${$w("#input5").value}
;
const body = `Booking details for: ${$w(“#input5”).value}
\rFirst Name: ${$w(“#input5”).value}
\rLast Name: ${$w(“#input7”).value}
\rEmail: ${$w(“#input6”).value}
\rPhone#: ${$w(“#input4”).value}
\rLocation: ${$w(“#input8”).value}
\rDate: ${$w(“#datePicker1”).value}
\rStart Time: ${$w(“#dropdown1”).value}
let comma = "";
let Combo / Bouncy Castles = ׳\rCombo and Bouncy Castles: ׳;
if ($w("#checkbox31").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + "Bounce n Slide";
comma = ", ";
}
if ($w("#checkbox32").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Paw Patrol";
comma = ", ";
}
if ($w("#checkbox33").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Island Life";
comma = ", ";
}
if ($w("#checkbox34").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Big Blue";
comma = ", ";
}
if ($w("#checkbox35").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Play Fort";
comma = ", ";
}
if ($w("#checkbox36").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Batman";
comma = ", ";
}
if ($w("#checkbox37").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Princess";
comma = ", ";
}
if ($w("#checkbox38").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Sparky";
comma = ", ";
}
if ($w("#checkbox39").checked) {
Combo / Bouncy Castles = Combo / Bouncy Castles + comma + "Fire Truck Bouncer";
comma = ", ";
}
if(comma !== ", ")
Combo / Bouncy Castles = "";
Booking details for: Nuzel
First Name: Nuzel
Last Name: Nuzelton
Email: anat.belinson@gmail.com
Phone#: 1234
Location: 1234
Date: Thu Apr 12 2018 00:00:00 GMT 0300 (IDT)
Start Time: 7PM
let comma = “”