- This topic has 7 replies, 2 voices, and was last updated 5 years, 9 months ago by
Support. This post has been viewed 2375 times
-
AuthorPosts
-
February 9, 2021 at 2:37 am #10036060
MoiraAllen
ParticipantHi – I am wondering if it is possible to change the placement of the Success Message. Once my form is completed and submitted the Success Message is at the top and hidden by my sticky menu. Is it possible to have the message appear at the bottom go the page?
February 9, 2021 at 3:25 am #10036069Support
KeymasterHello Moira,
You can change the HTML position of success/error message like the image below:

Move the HTML to after the last form-row.
Another good way is scroll to message div when send the form. For it change this part of code at “js/views/view.contact.js”:
... .... ...... }).always(function(data, textStatus, jqXHR) { $errorMessage.empty().hide(); if (data.response == 'success') { // Uncomment the code below to redirect for a thank you page // self.location = 'thank-you.html'; $messageSuccess.removeClass('d-none'); $messageError.addClass('d-none'); // Reset Form $form.find('.form-control') .val('') .blur() .parent() .removeClass('has-success') .removeClass('has-danger') .find('label.error') .remove(); if (($messageSuccess.offset().top - 80) < $(window).scrollTop()) { $('html, body').animate({ scrollTop: $messageSuccess.offset().top - 80 }, 300); } $form.find('.form-control').removeClass('error'); $submitButton.val( submitButtonText ).attr('disabled', false); // CODE FOR SCROLL TO SUCCESS DIV WHEN FORM IS SENT $('html, body').animate({ scrollTop: $messageSuccess.offset().top - 80 }, 300); return; } else if (data.response == 'error' && typeof data.errorMessage !== 'undefined') { $errorMessage.html(data.errorMessage).show(); } else { $errorMessage.html(data.responseText).show(); } $messageError.removeClass('d-none'); $messageSuccess.addClass('d-none'); if (($messageError.offset().top - 80) < $(window).scrollTop()) { $('html, body').animate({ scrollTop: $messageError.offset().top - 80 }, 300); } $form.find('.has-success') .removeClass('has-success'); $submitButton.val( submitButtonText ).attr('disabled', false); }); ... .... ....We hope this helps!
Please try that and let us know if you need further assistance.
Kind Regards,
Rodrigo.
If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
February 9, 2021 at 6:06 am #10036072MoiraAllen
ParticipantThanks, Rodrigo. I moved the HTML position of success/error message to after the </form> tag.
I opened the js/views/view.contact.js page and added the code you sent. But…the form does send but the “submit” button says “loading” and doesn’t change.
Thanks for your continued help.
February 9, 2021 at 6:26 am #10036073Support
KeymasterHello Moira,
Normally this infinite loading occurs when has some javascript error. But I did a test in your website now and couldn’t reproduce the issue with infinite “loading” button. The form is sending normally.
Please try to clear your browser cache.
Also please change the JS code to this new:
... .... ...... }).always(function(data, textStatus, jqXHR) { $errorMessage.empty().hide(); if (data.response == 'success') { // Uncomment the code below to redirect for a thank you page // self.location = 'thank-you.html'; $messageSuccess.removeClass('d-none'); $messageError.addClass('d-none'); // Reset Form $form.find('.form-control') .val('') .blur() .parent() .removeClass('has-success') .removeClass('has-danger') .find('label.error') .remove(); // CODE FOR SCROLL TO SUCCESS DIV WHEN FORM IS SENT if (($messageSuccess.offset().top - 80) < $(window).scrollTop()) { $('html, body').animate({ scrollTop: $messageSuccess.offset().top - 120 }, 300); } $form.find('.form-control').removeClass('error'); $submitButton.val( submitButtonText ).attr('disabled', false); return; } else if (data.response == 'error' && typeof data.errorMessage !== 'undefined') { $errorMessage.html(data.errorMessage).show(); } else { $errorMessage.html(data.responseText).show(); } $messageError.removeClass('d-none'); $messageSuccess.addClass('d-none'); if (($messageError.offset().top - 80) < $(window).scrollTop()) { $('html, body').animate({ scrollTop: $messageError.offset().top - 80 }, 300); } $form.find('.has-success') .removeClass('has-success'); $submitButton.val( submitButtonText ).attr('disabled', false); }); ... .... ....* Note I changed the offset value from 80 to 120:
scrollTop: $messageSuccess.offset().top - 120
This will position better the final scroll position when the form is sent (without stay behind the sticky menu).
Regarding change the position of HTML success/error messages, this is not needed if you are using the JS solution. But inspecting your code we can still see the HTML at very top of the form:

We hope this helps!
Kind Regards,
Rodrigo.
If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
February 10, 2021 at 2:57 am #10036103MoiraAllen
ParticipantHi Rodrigo – still having issues with the submit. I have 4 forms and have moved the “success/error” code to the bottom as well as changing the code in the view-contact.js page with the new one you sent. BUT still having the same issue. It just says “loading”. I tried this on another computer and had the same result.
One thing I notice is that in Dreamweaver it is saying there is an error in the js: ERROR:”jqXHR is defined but never used [n0-unused-vars]
I don’t know if this is important.Thanks for your help, Moira
February 10, 2021 at 3:06 am #10036104Support
KeymasterHello,
Inspecting your code I saw you put the success and error messages outside the
<form>...</form>. You need maintain inside the form:

Change to the position marked with green line in the above image.
Please try that and let us know if you need further assistance.
Kind Regards,
Rodrigo.
If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
February 10, 2021 at 3:23 am #10036106MoiraAllen
ParticipantOf course! That makes sense.
I did that and now I getting this message: Error! There was an error sending your message.
{“code”:”MethodNotAllowedError”,”message”:”POST is not allowed”}So what else do I need to fix 🙂
February 10, 2021 at 6:38 am #10036110Support
KeymasterHello Moira,
I did a test now and seems to be working normally:

Maybe you already resolved the issue ?
If you need further assistance feel free to contact us.
Kind Regards,
Rodrigo.
If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.