-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcadastramento.html
109 lines (98 loc) · 3.24 KB
/
cadastramento.html
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script type="text/javascript">
$(document).ready(function() {
//----------------------------------------------------------------------------------------------------------------------
$('#gravar').click(function(){
var curfile = window.location.href;
var curdir = curfile.substring(0, curfile.lastIndexOf('/')+1);
var res = grecaptcha.getResponse();
if (res.length < 100) { return; }
var datastring = '?' + 'cad01='+$('#cad01').val() +
'&cad02='+$('#cad02').val() +
'&cad03='+$('#cad03').val() +
'&cad04='+$('#cad04').val() +
'&g-recaptcha-response='+res ;
var url = curdir + 'php/sara_register.php';
$.ajax({
url: url + datastring,
type: 'GET',
dataType: 'html',
beforeSend: function(a){ },
success: function(a){
//$('#debug').html(a);
if (a=1) {
alert('Dados enviados com sucesso');
window.location.reload(true);
} else {
alert('Houve problemas de conexão. Tente mais tarde.');
}
},
error: function(a,b,c){ alert('Houve problemas de conexão. Tente mais tarde.'); },
complete: function(a,b){ }
});
});
//----------------------------------------------------------------------------------------------------------------------
});
</script>
<style>
body {
background-color:white;
}
div {
float:left;
width:100%;
margin-bottom:20px;
font-size:normal;
}
span {
margin-left:2px;
font-size:x-small;
}
</style>
</head>
<body>
<div id="head">
<h2>Cadastramento para a ferramenta móvel do SARA</h2>
</div>
<div id="ficha">
<table>
<tbody>
<tr>
<td>Nome completo<br /><span>(A primeira letra não pode ser espaço)</span></td>
</tr>
<tr>
<td><input type="text" onkeyup="this.value=this.value.replace(/^ /g,'');" id="cad01"></td>
</tr>
<tr>
<td>Endereço email<br /><span>(Não pode conter espaços)</span></td>
</tr>
<tr>
<td><input type="text" onkeyup="this.value=this.value.replace(/ /g,'');" id="cad02"></td>
</tr>
<tr>
<td>Número celular<br /><span>(só números)</span></td>
</tr>
<tr>
<td><input type="text" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" id="cad03"></td>
</tr>
<tr>
<td>Senha escolhida<br /><span>(Não pode conter espaços)</span></td>
</tr>
<tr>
<td><input type="password" onkeyup="this.value=this.value.replace(/ /g,'');" id="cad04"></td>
</tr>
</tbody>
</table>
</div>
<div class="g-recaptcha" data-sitekey="6Lc6QxMUAAAAAHgd8JKpFp3v-UjfJZBtUYpM5D5t"></div>
<div>
<button id="gravar">Gravar</button>
</div>
<div id="debug"></div>
</body>
</html>