Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boa tarde galera, tudo bem?
Tenho um formulario sendo validado com jQuery Validate.
Estou tendo problemas quando o script entra dentro do submitHandler, pois quero que seja executado uma função dentro dele, mas isso não está acontecendo.
Vejam o trecho em questão:
submitHandler: function(form) {
var dados = $(form).serialize();
$.ajax({
type: "POST",
url: "inc/processa.php",
data: dados,
success: function(data)
{
$("#name").val("");
$("#email").val("");
$("#comment").val("");
$("#security_question").val("");
$("#guestbook-notification").html('<p class="successmsg">Recado gravado com sucesso! Obrigado!</p>');
$("#recados").html(data);
setFormAutoValue('.validacao');
}
});
return false;
}
A função setFormAutoValue(); não está sendo executada. Ela é responsável por gerar uma nova "questão de segurança", um "captcha"...
Existe alguma forma em especial que precisa ser feito para chamar ela?
>
Não, não existe nenhuma forma especial.
Pq você acha que ela não está sendo executada ?
Sinceramente não sei. Ela não é executada nem a pau.
Ela está funcionando normalmente, pois ela é executada uma vez assim que a página é carregada e toda a vez que é necessário "atualizar somente o captcha". Mas quando é chamada dentro do submitHandler simplesmente não funciona.
Se eu colocar a chamada da função pra ser executada primeiro, o resto não funciona. Não dá pra entender porque, pois está sendo chamada como nos outros lugares.
Alguma idéia?
Veja a sintaxe da função
function setFormAutoValue(formulario) {
var $form2 = $(formulario);
$.ajax({
'url': 'action.php',
'data': {
get_auto_value: $form2.attr("id")
},
'type': "POST",
'dataType': 'json',
}).done(function(response) {
if (typeof response.data != 'undefined') {
$form2.find('.auto-safe span').text(unescape(response.data));
}
});
}-> O formulário possui a classe .validacao ?
-> O que aparece no console de erros ? Ctrl + Shift + J ?
-> Pq vc tem que chamar ela depois que o form é enviado ?
>
-> O formulário possui a classe .validacao ?
-> O que aparece no console de erros ? Ctrl + Shift + J ?
-> Pq você tem que chamar ela depois que o form é enviado ?
1. Sim, possui a classe.
2. aparece isso:
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2609ms]
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2593ms]
ReferenceError: gBrowser is not defined about:blank:313:6
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] js
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsITaskbarTabPreview.invalidate] WindowsPreviewPerTab.jsm:406:0
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] main.js
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] 71737050
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] recent
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] __utm.gif
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] 924653_915286181861936_1262355291_n.jpg
Use of getPreventDefault() is deprecated. Use defaultPrevented instead. jquery.min.js:3:0
Error: Exposing privileged or cross-origin callable is prohibited <unknown>
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] openhand_8_8.cur
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] ViewportInfoService.GetViewportInfo
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] transparent.png
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] gen_204
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] google_white2.png
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] mapcnt6.png
ReferenceError: gBrowser is not defined about:blank:313:6
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] AuthenticationService.Authenticate
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2562ms]
GET
https://mts1.googleapis.com/vt [HTTP/1.1 200 OK 1094ms]
GET
https://mts1.googleapis.com/vt [HTTP/1.1 200 OK 1643ms]
GET
https://mts1.googleapis.com/vt [HTTP/1.1 200 OK 2405ms]
GET
https://mts1.googleapis.com/vt [HTTP/1.1 200 OK 1658ms]
GET
https://mts1.googleapis.com/vt [HTTP/1.1 200 OK 2003ms]
GET
https://mts1.googleapis.com/vt [HTTP/1.1 200 OK 2265ms]
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2312ms]
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2578ms]
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2578ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] cb_scout2.png
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2515ms]
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2328ms]
GET
https://mts0.googleapis.com/vt [HTTP/1.1 200 OK 2516ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] imgs8.png
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] csi
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] vt
GET
https://csi.gstatic.com/csi [HTTP/1.1 204 No Content 500ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] csi
GET
https://maps.googleapis.com/maps/api/js/QuotaService.RecordEvent [HTTP/1.1 200 OK 297ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] QuotaService.RecordEvent
POST
https://safebrowsing.google.com/safebrowsing/downloads [HTTP/1.1 200 OK 1127ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] downloads
GET
https://safebrowsing-cache.google.com/safebrowsing/rd/ChVnb29nLWJhZGJpbnVybC1zaGF2YXI4AEACSgwIARCQrwMYka8DIAFKDAgAEIehBBiJoQQgAQ [HTTP/1.1 200 OK 828ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] ChVnb29nLWJhZGJpbnVybC1zaGF2YXI4AEACSgwIARCQrwMYka8DIAFKDAgAEIehBBiJoQQgAQ
GET
https://safebrowsing-cache.google.com/safebrowsing/rd/ChNnb29nLW1hbHdhcmUtc2hhdmFyOABAAkoMCAEQyc0LGM7NCyABSgwIABDBjgwYxo4MIAE [HTTP/1.1 200 OK 156ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] ChNnb29nLW1hbHdhcmUtc2hhdmFyOABAAkoMCAEQyc0LGM7NCyABSgwIABDBjgwYxo4MIAE
GET
https://safebrowsing-cache.google.com/safebrowsing/rd/ChFnb29nLXBoaXNoLXNoYXZhcjgAQAJKDAgBEOTZDRjn2Q0gAUoMCAAQ8MkYGPTJGCAB [HTTP/1.1 200 OK 188ms]
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] ChFnb29nLXBoaXNoLXNoYXZhcjgAQAJKDAgBEOTZDRjn2Q0gAUoMCAAQ8MkYGPTJGCAB
GET
XHR
http://localhost:801/jeff_sol/inc/checkQuestion.php [HTTP/1.1 200 OK 16ms]
POST
XHR
http://localhost:801/jeff_sol/inc/processa.php
3. É chamado para gerar uma nova "questão de segurança" para gravar um novo recado.
Não, não existe nenhuma forma especial.
Pq vc acha que ela não está sendo executada ?