I have created a form.
After submitting the form should be sent me an email.
That works too.
However, everything is always displayed to me.
How do I have to change the entry that the entry of the checkbox is displayed to me only if the checkbox was selected?
I hope I could explain it understandably, since my English is bad.
Hi,
Can you please send us a screenshot of the page? I’m not sure that I understand the use case.
Do you wish to send an Email Notification only if a checkbox is selected?
Please clarify what you would like to achieve.
many thanks for your response.
The notification should always be made when a request has been sent.
That works too.
In the mail, however, the checkboxes are always displayed, even if they have not been selected.
Checkboxes that were not selected but should not be displayed.
Hi,
I’m truly sorry for the delay. You should check the checkboxes values before concatenating them to the body string. it should look something similar to the following:
let body = `Name: ${$w("#input1").value}
\rName: ${$w("#input1").value}
\rTelefonnummer: ${$w("#input2").value}
\reMail: ${$w("#input3").value}
\reMail2: ${$w("#input4").value}
\rOrt: ${$w("#input5").value}
\rVeranstaltungsart: ${$w("#dropdown1").value}
\rVeranstaltungsdatum: ${$w("#datePicker1").value}
\rGästezahl: ${$w("#dropdown2").value}
\rMitteilung: ${$w("#textBox1").value}
\rDatenschutz gelesen: ${$w("#checkbox5").value}`;
if ($w("#checkbox1").value){
body+= `\rPersonalisiertes Gobo: ${$w("#checkbox1").value}`;
}
if ($w("#checkbox2").value){
body+= `\rAmbiente-Beleuchtung: ${$w("#checkbox2").value}`;
}
if ($w("#checkbox3").value){
body+= `\r2-Zonen-Beschallung: ${$w("#checkbox3").value}`;
}
if($w("#checkbox3").value){
body += `\rEröffnungstanz-Mix: ${$w("#checkbox4").value}`;
}
Firstly, the body variable should be declared as let instead of const . Click here to learn more about the difference. Moreover, you need to make sure that the variable ends with " ; " and that the string ends with backtick ( ` ) before using the if statement.
I recommend copying the code that I wrote above and make the necessary changes.
Okay…
Thank you for your answer.
This is unfortunately too complicated for me, because I have no programming knowledge.
Unfortunately, I can not speak English, so I can not learn it with the help of the link.
Then I can not use the function.
Many Thanks
Greetings Ronald