Vão na página contato, são dois formulários que verão: o do CONTATO e do INFORMATIVO...
Quando clica pra enviar ou o contato ou o informativo os 2 estão iniciando o processo do ajax do jQuery.
os códigos estão assim:
$(function() { $("#FormInformativo").ajaxStart (function() { $(".InforStatus").html("Cadastrando...").fadeIn("fast"); }); var options = { target: ".InforStatus", url: "informativo.php", type: "post", success: function() { setTimeout ("$('.InforStatus').fadeOut()", 3000); $(":input").each (function() { var type = this.type; var tag = this.tagName.toLowerCase(); if (type == "text" || tag == "textarea") { this.value = ""; } if (tag == "select") { this.selectedIndex = -1; } }); } } $("#FormInformativo").ajaxForm(options); });
$(function() { $("#contato").ajaxStart (function() { $(".status").html("<img class='carregando' src='imagens/carregando.gif' /><span class='TxtLoading'>Enviando...</span>").fadeIn("fast"); }); var options = { target: ".status", url: "contato/enviar.php", type: "post", success: function() { setTimeout ("$('.status').fadeOut()", 3000); $(":input").each (function() { var type = this.type; var tag = this.tagName.toLowerCase(); if (type == "text" || tag == "textarea") { this.value = ""; } if (tag == "select") { this.selectedIndex = -1; } }); } } $("#contato").ajaxForm(options); });
Reparem que o TARGET estão diferentes, mas mesmo assim os 2 forms estão iniciando no evento ajaxStart...
Edição feita por: cassiano designer, 15/11/2007, 15:58.