-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptcha.js
More file actions
40 lines (31 loc) · 1.16 KB
/
Copy pathcaptcha.js
File metadata and controls
40 lines (31 loc) · 1.16 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
<script type="text/javascript">
$(function() {
// Adiciona o captcha.
Recaptcha.create("6LfyUe0SAAAAAKexAYn01ad_B8ck8JVc25cuo_qb", "captcha", {
callback: Recaptcha.focus_response_field, theme:"white", lang:readCookie('IDIOMA')})
});
$(document).ready(function() {
// Valida e submete o form de consulta de protocolo.
$("#searchProtocolForm").on("submit", function() {
if ($("#protocolNumber").val() == "") {
alert("O preenchimento do número do protocolo é obrigatório");
} else if ($("#recaptcha_response_field").val() == "" ) {
alert("O preenchimento do texto de confirmação é obrigatório!");
} else {
$(".fa-search").removeClass("fa-search");
$(".fa").addClass("fa-spinner");
$(".fa-spinner").addClass("fa-spin");
$("#submit_form").attr("disabled","disabled");
$.ajax({
type: "POST",
url: "./search.php",
data: $("#searchProtocolForm").serialize(),
success: function(data) {
$("#tile2").html(data);
}
});
}
return true;
})
});
</script>