1. Macro
  2. Thursday, 03 August 2017
Hi, i have problems with my contact form. When i Send a message it get delivered but no successul message, icon is spinning in loop. I update all that extensions, tried to delete site.php it gives success message but then layout is messed up (4 rows).
http://www.giorgiotartaro.com/contatti
Accepted Answer
Hi there,

Go to components/com_sppagebuilder/assets/js/sppagebuilder.js file and find bellow code:


//Ajax Contact Form
jQuery(function($) {
$(document).on('submit', '.sppb-ajaxt-contact-form', function(event) {

event.preventDefault();

var $self = $(this);
var value = $(this).serializeArray();
var request = {
'option' : 'com_sppagebuilder',
'task' : 'ajax',
'addon' : 'ajax_contact',
'data' : value
};

$.ajax({
type : 'POST',
data : request,
beforeSend: function(){
$self.find('.fa').addClass('fa-spinner fa-spin');
},
success: function (response) {
$self.find('.fa-spin').removeClass('fa-spinner fa-spin');
$self.trigger('reset');
$self.next('.sppb-ajax-contact-status').html($.parseJSON(response).data).fadeIn().delay(4000).fadeOut(500);;
}
});

return false;
});
});


and replace it with bellow code


//Ajax Contact Form
jQuery(function($) {
$(document).on('submit', '.sppb-ajaxt-contact-form', function(event) {

event.preventDefault();

var $self = $(this);
var value = $(this).serializeArray();
var request = {
'option' : 'com_sppagebuilder',
'task' : 'ajax',
'addon' : 'ajax_contact',
'g-recaptcha-response' : $self.find('#g-recaptcha-response').val(),
'data' : value
};

$.ajax({
type : 'POST',
data : request,
beforeSend: function(){
$self.find('.fa').addClass('fa-spinner fa-spin');
},
success: function (response) {
var results = $.parseJSON(response);

try {
var data = $.parseJSON(results.data);
var content = data.content;
var type = 'json';
} catch (e) {
var content = results.data;
var type = 'strings';
}

if (type == 'json') {
if(data.status) {
$self.trigger('reset');
}
} else {
$self.trigger('reset');
}

$self.find('.fa-spin').removeClass('fa-spinner fa-spin');
$self.next('.sppb-ajax-contact-status').html(content).fadeIn().delay(4000).fadeOut(500);
}
});

return false;
});
});


Let me know if it's working for you.

Thanks.
  1. more than a month ago
  2. Macro
  3. # Permalink
Responses (3)
Thanks, it works
  1. more than a month ago
  2. Macro
  3. # 1
Thanks, it works


You are welcome.
  1. more than a month ago
  2. Macro
  3. # 2


There are no replies made for this post yet.
Be one of the first to reply to this post!


This forum is archived

This forum has been archived. Please use JoomShaper official support system.