Camaradas, como faço para enviar o usúario para uma página de agradecimento após esse formulário ?
$().ready (function () {
$("#telefone").mask("(99) 9999-9999?9");
$('form.ajax-form').on('submit', function() {
var obj = $(this), // (*) references the current object/form each time
url = obj.attr('action'),
method = obj.attr('method'),
data = {};
obj.find('[name]').each(function(index, value) {
// console.log(value);
var obj = $(this),
name = obj.attr('name'),
value = obj.val();
data[name] = value;
});
$.ajax({
// see the (*)
url: url,
type: method,
data: data,
dataType: "json",
success: function(response) {
//console.log(response.mensage);
$("#feedback").html(response.mensage);
if(response.error == false){
obj[0].reset();
alert("Email cadastrado com sucesso!");
}
}
});
return false; //disable refresh
});
});
Dese já agradeço.