forked from Arthurbric/ReadWrite4All-Pi1
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
62 lines (52 loc) · 1.56 KB
/
script.js
File metadata and controls
62 lines (52 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function getSelectedRadioValue(formName) {
const radios = document.getElementsByName(formName);
for (let radio of radios) {
if (radio.checked) {
return radio.value;
}
}
return null;
}
function sendMail() {
// const foto = getSelectedRadioValue("documento");
const turno = getSelectedRadioValue("turno");
const matricula = getSelectedRadioValue("ensino");
const dificuldade = getSelectedRadioValue("deficiencia");
const serie = getSelectedRadioValue("serie");
// if (!foto) {
// alert("Por favor, tire uma foto do seu documento.");
// return;
// }
if (!turno) {
alert("Por favor, selecione um turno.");
return;
}
if (!matricula) {
alert("Por favor, selecione uma matricula.");
return;
}
if (!dificuldade) {
alert("Por favor, selecione uma deficiencia.");
return;
}
if (!serie) {
alert("Por favor, selecione uma serie.");
return;
}
let parms = {
// foto: foto,
turno: turno,
serie: serie,
matricula: matricula,
dificuldade: dificuldade,
telefone: document.getElementById("telefone").value,
};
emailjs.send("service_s69xwzr", "template_tvu3aj4", parms)
.then(function(response) {
console.log('SUCCESS!', response.status, response.text);
alert('Email enviado com sucesso!');
}, function(error) {
console.log('FAILED...', error);
alert('Houve um erro ao enviar o email: ' + JSON.stringify(error));
});
}