Hi there, I've built this site some years ago and now the contact form refuses to send email. When I don't use smtp the form gives a succesful message but never sends the email. When I use smtp there is just endless loading. What would be the fastest way to upgrade all site components? And if that's too much how can I get the contact forms to work again at least? Thanks!
Upgrade old site's contact forms
17 replies · opened Aug 17, 2022
Hello,
We have checked out your Website and you are using a very old version of Canvas. In this case, the only way to upgrade to the Latest Version is to start from scratch as there are many changes in the Latest Version of Canvas than your Version.
Fortunately, if you would like to just upgrade the Contact Forms, it is possible! Update the following:
include/sendemail.phpFile toinclude/form.phpFile.include/phpmailerFolder to the Latest Version.The HTML Codes for the Form to the Latest Version.
This should work fine. Please let us know if you are facing any issues and we can have a look. You can find further details of SMTP Usage here: https://docs.semicolonweb.com/docs/forms/form-setup/ .
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues. Thanks. :)
Thanks for your reply. I've done the first two steps and now I get "Bot detected" when trying to submit the form. Could you elaborate a bit on step 3? Or let me know what I need to change specifically in my contact form to maintain the look it has but also be functional? This is my html code at the moment:
Wyślij Wiadomość
Dołożymy wszelkich starań, aby skontaktować się z Tobą w ciągu 6-8 godzin roboczych.
Hello,
Thanks for your Patience!
As we have mentioned above, you will also need to use the Latest HTML Codes for the Contact Forms from the Latest Package Files. The codes you are using for your Forms is old and this is why it does not work. Please update the Latest Version and this should be resolved.
Additionally, also make sure that you update the contactForm: function() Function Block to ajaxForm: function() and SEMICOLON.widget.contactForm(); to SEMICOLON.widget.ajaxForm();. Here is the ajaxForm: function() Function Block:
[ch_pre type="js"]ajaxForm: function(){
if( !$().validate ) {
console.log('ajaxForm: Form Validate not Defined.');
return true;
}
if( !$().ajaxSubmit ) {
console.log('ajaxForm: jQuery Form not Defined.');
return true;
}
var $ajaxForm = $('.form-widget:not(.customjs)');
if( $ajaxForm.length 0 ) {
error.appendTo( elementItem.parents('.form-group') );
} else {
error.insertAfter( elementItem );
}
},
focusCleanup: true,
submitHandler: function(form) {
elementResult.hide();
if( elementLoader == 'button' ) {
var defButton = $(form).find('button'),
defButtonText = defButton.html();
defButton.html('');
} else {
$(form).find('.form-process').fadeIn();
}
if( elementFormId ) {
$body.removeClass( elementFormId + '-ready ' + elementFormId + '-complete ' + elementFormId + '-success ' + elementFormId + '-error' ).addClass( elementFormId + '-processing' );
}
$(form).ajaxSubmit({
target: elementResult,
dataType: 'json',
success: function( data ) {
if( elementLoader == 'button' ) {
defButton.html( defButtonText );
} else {
$(form).find('.form-process').fadeOut();
}
if( data.alert != 'error' && elementRedirect ){
window.location.replace( elementRedirect );
return true;
}
if( elementAlert == 'inline' ) {
if( data.alert == 'error' ) {
var alertType = 'alert-danger';
} else {
var alertType = 'alert-success';
}
elementResult.removeClass( 'alert-danger alert-success' ).addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 );
} else if( elementAlert == 'notify' ) {
elementResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html('');
SEMICOLON.widget.notifications( elementResult );
}
if( data.alert != 'error' ) {
$(form).resetForm();
$(form).find('.btn-group > .btn').removeClass('active');
if( (typeof tinyMCE != 'undefined') && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden() ){
tinymce.activeEditor.setContent('');
}
var rangeSlider = $(form).find('.input-range-slider');
if( rangeSlider.length > 0 ) {
rangeSlider.each( function(){
var range = $(this).data('ionRangeSlider');
range.reset();
});
}
var ratings = $(form).find('.input-rating');
if( ratings.length > 0 ) {
ratings.each( function(){
$(this).rating('reset');
});
}
var selectPicker = $(form).find('.selectpicker');
if( selectPicker.length > 0 ) {
selectPicker.each( function(){
$(this).selectpicker('val', '');
$(this).selectpicker('deselectAll');
});
}
$(form).find('.input-select2,select[data-selectsplitter-firstselect-selector]').change();
$(form).trigger( 'formSubmitSuccess' );
$body.removeClass( elementFormId + '-error' ).addClass( elementFormId + '-success' );
} else {
$(form).trigger( 'formSubmitError' );
$body.removeClass( elementFormId + '-success' ).addClass( elementFormId + '-error' );
}
if( elementFormId ) {
$body.removeClass( elementFormId + '-processing' ).addClass( elementFormId + '-complete' );
}
if( $(form).find('.g-recaptcha').children('div').length > 0 ) { grecaptcha.reset(); }
}
});
}
});
});
},[/ch_pre]
This will definitely work fine. Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Hi again, I followed your advice but now I get "bot detected". Replaced functions.js with the new version and made some changes to the html codes of the form but to no avail? I have also filled in smtp settings. Could u tell me specifically what I need to change in the html if it's not too much trouble? Don't have the time to start over on this website. I'd be happy to give u ftp access if needed, thanks in advance.
Again, the site is https://417.pl/417
Hello,
Yes, please provide us with your FTP Details in a private reply so that we can look into this from our end and try fixing this.
Thanks for your Patience.
Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.
Hi and thanks, this is the info
host: red-hulk.dreamhost.com
user: dh_vr7xr3
pass: F3%Pc%?G{`z5H$v9
port 22 SFTP
Thanks again
Hi there, is there an update on this? Thanks.
Hello,
Thanks for your Patience and Apologies for the Delays.
We will look into this and fix the issues on your Files on the Servers via FTP within the next 24 hours.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Hello,
The above instructions were not followed which is why there are many issues currently. Firstly, we had mentioned just updating the contactForm Function Block in the js/functions.js File and not the entire File. So please rollback to the default js/functions.js File from the Version of Canvas you are using (we cannot see this as you have deleted this information from the style.css File) and update just the contactForm Function Block as mentioned in the above replies.
We have fixed HTML issues and after updating the JS Codes, the issues should be resolved. Please make sure that the instructions are followed as closely as possible to avoid delays and unnecessary issues.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Hi again,
So I've reverted to the old functions.js file and replaced contactForm: function() to ajaxForm: function() and SEMICOLON.widget.contactForm(); to SEMICOLON.widget.ajaxForm();. Aplologies for any confusion on my part. I see the changes you made in the html file but sadly the site just loads an empty page. That happened before I reverted back to the old functions js file. I assumed it would get back to normal once I did that. It was loading fine before, any ideas on the issue? Thanks again and I appreciate your time and effort.
- Theo
Hello,
No worries. We understand.
Please update the js/functions.js File online and this issue should be resolved automatically. And the Contact Form should also work fine.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
As I've said I've already rolled back to the old functions.js with the changes you mentioned. I believe the problem with the blank page is coming from the changed html somehow, please correct me if I'm wrong. This is now my full functions.js, same one uploaded on the server:
var $ = jQuery.noConflict();
....
})(jQuery);Hello,
The Codes you have provided here, appears to be correct but the Online Version: https://www.417.pl/417/js/functions.js has not been updated. Can you please consider checking this and update the files accordingly online as well so that the changes can take effect? Additionally, the HTML Codes will not cause a Blank Page, usually, this is due to JS Conflicts and in this case due to the js/functions.js File.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
This is strange at the very least. When I download functions.js via ftp from the server, it is the same file I attached here last with the correct codes. When I check the link https://www.417.pl/417/js/functions.js and ctrl-f and search for the codes, SEMICOLON.widget.ajaxForm(); is present but cannot find ajaxForm: function(). Could this be caused by the lack of formatting when viewed in browser? Again, the correct file is present on the server in the right directory but the problem seems to persist. I'm boggled as to this one, something I thought would be a simple fix is turning into a mission. Any other clues as to why?
Thanks again
Hello,
Ohh wow! Very Strange.. Only explanation for this is there is some Caching Plugin or Caching enabled on your Servers or passing through some CDN (like Cloudflare), that is causing this. Clearing/Purging the Cache manually should fix this issue.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Purging the cache on Cloudflare seems to have done the trick so thanks for that, would run a few more laps before I thought of it myself! The form also works as expected with the exception of displaying messages in a blank page like this: { "alert": "success", "message": "We have successfully received your Message and will get Back to you as soon as possible." } and doesn't require any field to be completed in order to send which could result in empty form submissions. I'd also like to keep the modal window that was popping up on the right upper corner of the page.
Thanks again!
Hello,
Thanks for the update. Always Happy to Help! :)
Okay, so there was an issue. What we meant with the ajaxForm: function() Function Block was that you would have also needed to update the codes of the function as well, as we have already provided above in one of our replies. We have updated this for you via FTP, now you will need to purge the cache again on Cloudflare. This should fix the issue with Form Validation and also the Notifications.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Have the same question, or something new?
Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.
Reply on the dashboard