Skip to content

Commit

Permalink
Alterações da API de envio de dados
Browse files Browse the repository at this point in the history
  • Loading branch information
tonylincon1 committed May 18, 2022
1 parent 86d5fa9 commit 71673ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 6 additions & 1 deletion css/styleform.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ input#LinkQuetionario {
border: 2px solid #1C0A94;
}

input[type="file"] {
display: inline-block;
}

label {
color: #1C0A94;
font-size: 15px
Expand Down Expand Up @@ -248,7 +252,8 @@ input[type="submit"] {

span.msg-erro.msg-envio {
text-align: center;
font-size: 20px;
font-size: 40px;
line-height: 50px;
}

/* Formulário */
Expand Down
2 changes: 1 addition & 1 deletion inscricao.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ <h2>Formulário de Inscrição</h2>
<textarea id="Interesse" name="Interesse" placeholder="Escreva sobre seu interesse no programa"></textarea>
<span class='msg-erro msg-interesse'></span>

<input type="text" class="LinkQuetionario" id="LinkQuetionario" placeholder="*Link do PDF do Questionário de Deligência no Google Drive">
<label for="LinkQuetionario">Questionário de Deligência: </label><input type="file" name="LinkQuetionario" class="LinkQuetionario" id="LinkQuetionario" required>
<span class='msg-erro msg-questionario'></span>

<div class="Politicadiv">
Expand Down
12 changes: 7 additions & 5 deletions js/validatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ var form = document.getElementById('Página1');

/* Validalink */
function validlink (tagErro,tagCampo){
filter = /https:*/;
filter = /https:\/\/drive\.google\.com\/file\/d\/(.*?)\/.*?\?usp=sharing/;
caixa = document.querySelector(tagErro);
if (filter.test(tagCampo.value)) {
caixa.style.display = 'none';
}
else{
caixa.innerHTML = "*Por favor, adicione o link do seu questionário de deligência para termos acesso (Exemplo: https:meulink.com.br)";
caixa.innerHTML = "*Por favor, gere um link de compartilhamento no google drive do seu questionário de deligência (Basta apenas importar o arquivo no google drive e gerar um link compartilhado)";
caixa.style.display = 'block';
contErro += 1;
}
Expand All @@ -86,7 +86,6 @@ var form = document.getElementById('Página1');
required('.msg-publico',publico,"Público de Reassentamento?")
required('.msg-interesse',interesse,"Interesse no programa")
required('.msg-questionario',interesse,"Link do Questionário")
validlink('.msg-questionario',LinkQuetionario)



Expand All @@ -97,15 +96,18 @@ var form = document.getElementById('Página1');
else {
form.addEventListener("submit", e => {
e.preventDefault();
fetch("https://sheetdb.io/api/v1/t3cvu8k1w0df4", {
fetch("https://hook.us1.make.com/emo6d98bfrbhh4saeuxgxpmlvipjijv9", {
method : "POST",
body: new FormData(document.getElementById("Página1")),
}).then(
response => response.json()
response => response.toString()
).then((html) => {
envio = document.querySelector(".msg-envio");
envio.innerHTML = "Suas respostas foram enviadas com sucesso!";
envio.style.display = 'block';
setTimeout(function() {
window.location.href = "index.html";
}, 4000);
})
});
}
Expand Down

0 comments on commit 71673ab

Please sign in to comment.