Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1461199

    Hi,

    The contact form submission that populates ‘Your message has been sent’
    on mobile it displays higher up the content, so it is not visible when you submit.

    Is there a way to change, or CSS that can be pplied so that the message is viewable?

    Thanks

    #1461278

    Hey woogie07,

    Thank you for the inquiry.

    The sent message is visible when we checked. Please check the screenshot in the private field. Would you mind providing a screenshot? You can use platforms like Savvyify, Imgur or Dropbox to upload and share the screenshot. Here are the steps to follow:

    1.) Visit the website of your chosen platform, such as Savvyify, Imgur or Dropbox.
    2.) Locate the option to upload a file or an image.
    3.) Select the screenshot file from your computer or device and upload it to the platform.
    4.) After the upload is complete, you will be provided with a shareable link or an embed code.
    5.) Copy the link or code and include it in your message or response to provide us with the screenshot.

    Thank you for taking the time to share the screenshot. It will help us better understand the issue you’re facing and provide appropriate assistance.

    Best regards,
    Ismael

    #1461300

    Hi

    I have attached the screen capture of the screen on mobile display after you click the form submit button.

    It cuts off the ‘Your Message has been sent’ which displays higher up – therefore you have to scroll up to see it.

    Thanks

    #1461492

    Hi,
    Thank you for your patience, yry adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function center_the_contact_form_ajax_response_after_the_submit_button_is_clicked() { ?>
      <script>
    document.addEventListener('DOMContentLoaded', function () {
        var buttons = document.querySelectorAll(".button.av-verify-recaptcha-0.av-recaptcha-submit");
    
        buttons.forEach(function(button) {
            button.addEventListener("click", function(event) {
                setTimeout(function() {
                    var resultElement = document.getElementById("result_ajax_response_1");
                    if (resultElement) {
                        resultElement.style.display = 'block'; 
                        var elementRect = resultElement.getBoundingClientRect();
                        var absoluteElementTop = elementRect.top + window.pageYOffset;
                        var middle = absoluteElementTop - (window.innerHeight / 2);
    
                        window.scrollTo({
                            top: middle,
                            behavior: 'smooth'
                        });
                    }
                }, 7000);
            });
        });
    });
    </script>
      <?php
    }
    add_action( 'wp_footer', 'center_the_contact_form_ajax_response_after_the_submit_button_is_clicked', 99 );

    This will center the contact form ajax response after the submit button is clicked, in my tests the time can be between 5 – 7 seconds while the recaptcha checks before the ajax response is shown. Some of this could be because I’m in a different country, so give this a try and adjust the 7000 at the end of the script to 5000 or 6000 to see what works best for you.
    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.